Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Edit: Changed this from email because email validation is a can of worms as an example

Email honestly seems much more straightforward than dates... Sweden had a Feb 30 in 1712, and there's all sorts of date ranges that never existed in most countries (e.g. the American colonies skipped September 3-13 in 1752).



It’s a ISO-standard to use Gregorian dates even for dates predating its invention. If you need to support anything else (I never had to in my Eurocentric work so far), you’ll need to model calendars, similar to how temporal did for JavaScript: https://tc39.es/proposal-temporal/docs/calendars.html


Dates are unfortunate in that you can only really parse them reliably with a TZDB.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: