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

Support Dates #13

Open
dannyfritz opened this issue Oct 8, 2013 · 7 comments
Open

Support Dates #13

dannyfritz opened this issue Oct 8, 2013 · 7 comments

Comments

@dannyfritz
Copy link

When Arg.stringify comes across a Date object it falls on its face: http://jsfiddle.net/JVECJ/

https://github.com/stretchr/arg.js/blob/master/src/arg.js#L127 needs to additionally have an instanceof check for Date.

@dannyfritz
Copy link
Author

Updated to 1.1 and it seems to be good now. Oops!

@matryer
Copy link
Member

matryer commented Oct 8, 2013

Hmm - I'm not sure what v1.1. did to address that to be honest. I wonder if you could write a test for it?

@dannyfritz
Copy link
Author

I was mistaken when I closed it out. I can write a test and fix later today.

@dannyfritz dannyfritz reopened this Oct 8, 2013
@dannyfritz
Copy link
Author

make that tomorrow afternoon.

@dannyfritz
Copy link
Author

It seems like JavaScript doesn't have any good cross-browser method of parsing an ISO date string.
Seems creating a dependency on a library or a shim on the date object is the best solution, but not very good.

http://stackoverflow.com/questions/5802461/javascript-which-browsers-support-parsing-of-iso-8601-date-string-with-date-par
http://stackoverflow.com/questions/4829569/help-parsing-iso-8601-date-in-javascript

@matryer
Copy link
Member

matryer commented Oct 10, 2013

What about some kind of plugin system that gives handlers a chance to try to deal with the value before it's returned.

Then we can have other features that people can include if need be.

Or we could recommend using unix time and handle those explicitly?

Sent from my iPhone

On 9 Oct 2013, at 18:58, Danny Fritz notifications@github.com wrote:

It seems like JavaScript doesn't have any good cross-browser method of parsing an ISO date string.
Seems creating a dependency on a library or a shim on the date object is the best solution, but not very good.

http://stackoverflow.com/questions/5802461/javascript-which-browsers-support-parsing-of-iso-8601-date-string-with-date-par
http://stackoverflow.com/questions/4829569/help-parsing-iso-8601-date-in-javascript


Reply to this email directly or view it on GitHub.

@dannyfritz
Copy link
Author

I had considered UNIX time, but it is hard to discern between a number and UNIX time. It would require user intervention after parsing to get Date objects.

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

No branches or pull requests

2 participants