wanasit / chrono

A natural language date parser in Javascript
MIT License
4.6k stars 341 forks source link

feat: add support to unix timestamp #549

Open RodrigoDornelles opened 7 months ago

RodrigoDornelles commented 7 months ago

It is interesting to support the Posix standard as one of the formats compatible with the parser.

wanasit commented 5 months ago

Hello. Sorry for my slow reply and thank you for your suggestion.

Could you clarify what Posix standard/pattern/format you mean? (link?) Or you are suggesting we should recognize 10digits numbers in the possible range (e.g. 1717236990) as a timestamp?

If it's the latter, I'm not sure if we should include it in the default setting.

RodrigoDornelles commented 5 months ago

Could you clarify what Posix standard/pattern/format you mean? (link?) Or you are suggesting we should recognize 10digits numbers in the possible range (e.g. 1717236990) as a timestamp?

That would be it, you wouldn't need a decorator around the function, maybe it supports unix:1111111111, it's not human readable which is what the lib proposes, but it ends up being useful anyway.