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

Array of dates #395

Closed
wants to merge 3 commits into from
Closed

Conversation

edumoreira1506
Copy link

The issue #379 said about return one array of dates, like input be:

[
     {
          'options': {},
          'text': '2012-08-02T13:00:00'
     },
     {
          'options': {},
          'text': '2012-08-02T13:00:00+01:00'
     },
]

And output:
[2012-08-02 13:00:00 -0300, 2012-08-02 13:00:00 +0100, 2019-09-10 12:00:00 -0300]

So I added a new method, parse_array than receives a array in input and use the same method of "Chronic.parse" for parse the dates and return an array of dates :)

@davispuh
Copy link
Collaborator

This doesn't solve #379 in that issue problem is that Chronic.parse('yesterday and today') returns just one date not both.

Also I don't really see this that useful, everyone can iterate it themselves and they might have different structure anyway.

@edumoreira1506
Copy link
Author

edumoreira1506 commented Sep 11, 2019

Oh, ok. I thought then that will be more easy for create a method that returns a array of dates, because currently we need to do manually this iterating over array and using the method and are some situations that this way would be easier, for example get dates from database and need to parse all of them or parse array of strings that user send something like one "schedule", but ok.

lib/chronic.rb Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants