Skip to content

Instantly share code, notes, and snippets.

View bradgessler's full-sized avatar

Brad Gessler bradgessler

View GitHub Profile
@eric1234
eric1234 / chronic_integration.rb
Last active February 17, 2021 20:20
chronic/ruby/rails integration
# https://gist.github.com/eric1234/3739149
#
# Mass monkey-patching! Provides integration between Chronic, Ruby and
# Rails. So now these all work:
#
# Date.parse "next summer"
# DateTime.parse "in 3 hours"
# Time.parse "3 months ago saturday at 5:00 pm"
#
# In addition we override String#to_date, String#to_datetime, String#to_time.