4 ms·
Nothing wrong with that. Can be useful for non-Ruby apps, for example. BTW. A JSONP version could make usable from JavaScript..
by nir 17y ago
Nothing wrong with that. Can be useful for non-Ruby apps, for example. BTW. A JSONP version could make usable from JavaScript..
- tptacek 17y agoIt's already usable from JS. $.get("/time-thingy/utc/" + whatever, function(date) { alert("your UTC timestamp is " + date); }); Not to be snarky, though, but this seems pretty silly. What major web framework doesn't have natural-language date parsing? There are BSD-licensed C libraries that do it. Why remote that?
- nir 17y agoI was thinking more as a web service, so JSONP is for cross site XHR. I assume someone would not have a good NL date parser for their environment, or won't be able to run it for some reason, or would simply prefer Chronic. A lot of stuff that seems pointless ends up being useful, and vice versa. Assuming it's on Heroku's free plan, it costs nothing to run forever, so why not? If it helps 10 people, it already beat most web pages.
- fizx 17y agoPointers to the C libraries, please! (beyond GNU Getdate, which doesn't really do this.)
- tptacek 17y agoI went looking for the one CVS uses, found this: http://www.datejs.com/ http://www.datejs.com/ and stopped looking.