Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add time precision option #6

Open
rykov opened this issue May 26, 2010 · 2 comments
Open

Add time precision option #6

rykov opened this issue May 26, 2010 · 2 comments

Comments

@rykov
Copy link

rykov commented May 26, 2010

Following the example of Chronic gem for Ruby, it would be great for the library to have an option to return a date range based on the precision of entry. Here are some examples of what inputs/outputs would look like:

"Jan 20, 2010 9:10pm" => "Jan 20, 2010 9:10:00pm" to "Jan 20, 2010 9:10:59pm"
"Jan 20, 2010 9pm" => "Jan 20, 2010 9:00:00pm" to "Jan 20, 2010 9:59:59pm"
"Jan 20, 2010" => "Jan 20, 2010 00:00:00am" to "Jan 20, 2010 11:59:59pm"
"Jan 2010" => "Jan 1, 2010 00:00:00am" to "Jan 31, 2010 11:59:59pm"
"2010" => "Jan 1, 2010 00:00:00am" to "Dec 31, 2010 11:59:59pm"

@joestelmach
Copy link
Owner

Thanks for the suggestion, but I'm not convinced that the usefulness of this feature outweighs the complexity. Have you used this feature in chronic? Can you give me an example use case?

@rykov
Copy link
Author

rykov commented Jun 3, 2010

Yep, I'm using the described feature in Chronic. The usefulness comes from ability to recognize precision - imagine entering "June 2, 2010" for an all-day event in your calendar vs. entering "June 2, 2010 12:00am" for one at a specified time. Currently, there is no way to recognize the difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants