Skip to content

1000Memories/dateable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dateable

Dateable is a plugin to integrate features from Chronic into ActiveRecord

INSTALLATION

just throw dateable into your gemfile

gem 'dateable'

USAGE

Create a database migration with the fields #{field}, #{field}_string, and #{field}_specificity

create_table :calendar_entries do |table|
  table.datetime :appointment_date
  table.string   :appointment_date_string
  table.string   :appointment_date_specificity
end

Then, whenever you update #{field}_string, #{field} and #{field}_specificity get updated accordingly:

entry = CalendarEntry.create
entry.appointment_date_string = 'May 18th, 1985'
entry.save

$ entry.appointment_date.to_s
=> "1985-05-18 00:00:00 -0700"

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published