0.01
No release in over 3 years
Low commit activity in last 3 years
Parse time/date natural language query strings with Chronic
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 0.10.2, >= 0.10.2
~> 4.0
 Project Readme

ransack_chronic

Parses natural language queries with Chronic when searching time/date columns with Ransack

Installation

Add this line to your application's Gemfile:

gem 'ransack_chronic'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ransack_chronic

Usage

This gem will override Ransack's cast_to_date and cast_to_time methods to allow natural language date queries.

You will now be able search on date columns with queries like "1 week ago", "2 days from now" or "thursday last week".

Take a look at the Chronic docs for more examples.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request