Ruby/Rails: Converting datetime to natural language (e.g. 3/23/2012 to “this Friday”)

后端 未结 3 1864
臣服心动
臣服心动 2020-12-15 13:04

Is anyone aware of a gem, method, or code snippet that will convert datetime values into sometime more human-friendly without having to create a series of rules or put a bun

3条回答
  •  长情又很酷
    2020-12-15 13:41

    The goal of the Hublot gem is to solve this problem — to be a "reverse Chronic".

    https://github.com/brettshollenberger/hublot

    Related question: Ruby/Rails - Convert Date/Time back into Natural Language (2011-02-17 => February 17th, 2011)

提交回复
热议问题