Hacker News new | ask | show | jobs
by mickeypi 2548 days ago
Unfortunately it inherits JSON’s lack of support for dates.
3 comments

It has a way to define types with regexps, so you can get a decent approximation of date support.

I wish there was a way to implement more complex validation rules with custom code, although I'm not sure which language that would better be.

What’s the use case for dates in a config language?

crontab is an example that comes to mind, but it uses its own system of date-time patterns. Javascript Date objects wouldnt be suitable.

Date arithmetic, parsing and formatting are very useful in config languages. Maybe your configs needs to express that when a program is run, the input should be read from a log file from two days ago named like /foo/bar/2019/07/02/access.log. That requires knowing what the current time is, computing what the time was two days ago, and formatting it in an arbitrary custom format (in this case YYYY/MM/DD).

That doesn't necessarily mean that the language needs dates as a first class data type with a literal syntax etc.

Cue hasn't reached 1.0 yet, so maybe it will be added? I don't see an issue for it, but you could ask.