Code Monkey home page Code Monkey logo

autochronic's Introduction

= Autochronic
<b>Version 0.2.0 (7 Feb, 2008)</b>

Author::    Yossef Mendelssohn ([email protected])
Copyright:: Copyright (c) 2008, Flawed Logic, OG Consulting, Yossef Mendelssohn
License::   MIT License.  See MIT-LICENSE file for more details.

Autochronic is a Ruby on Rails that will automatically make any date or datetime attribute in any model automatically handle natural-language strings. There is no effort on your part, no creation of before_save callbacks or writing your own accessors to handle the special input.

== Installation

Unpack the autochronic directory into vendor/rails/ in your rails project.
A definitive public revision control access point is forthcoming that will make it possible to install the plugin via script/plugin install.

== Using Autochronic

Just use your models normally. They'll do the work for you automatically. Automatic Chronic. Auto Chronic. Autochronic.

== Version history:

  0.2.0 - Initial release
    Developed under Rails 2.0.2 using chronic 0.2.3. That worked for me, and I'm not making any guarantees for anything else.

== Known issues:

  Chronic's parsing of 'today' is time-dependent in a bad way. See the following irb dump.
  
    >> Chronic.parse('today')
    => Fri Feb 08 00:00:00 -0600 2008
    >> Date.today.to_s
    => "2008-02-07"
    >> Time.now
    => Thu Feb 07 23:13:28 -0600 2008
    More info:
    >> Time.local(2008, 2, 7, 22, 59, 59)
    => Thu Feb 07 22:59:59 -0600 2008
    >> time1 = _
    => Thu Feb 07 22:59:59 -0600 2008
    >> time2 = Time.local(2008, 2, 7, 23, 0, 0)
    => Thu Feb 07 23:00:00 -0600 2008
    >> Chronic.parse('today', :now => time1)
    => Thu Feb 07 23:30:00 -0600 2008
    >> Chronic.parse('today', :now => time2)
    => Fri Feb 08 00:00:00 -0600 2008

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.