1

I have a model User with a "birthday" field of type "date". The problem is that waterline converts its value to the JavaScript Date object that is restricted to minimum of the year 1970. Obviously there are some people with a year of birth less than 1970.

So is there some way to fully rewrite functions for formatting and validation for the specific field? And may be I can do it without breaking compatibility with any of adapters?

Timofey
  • 141
  • 6
  • What limitation? `Date` can use negative integers to represent dates before 1970 - try `new Date(-1000000000000)`. – Robert Rossmann Apr 30 '15 at 08:14
  • @RobertRossmann Oh, how foolish was that. I tried to call new Date(1950) and got a date with 1 Jan 1970 but when I called new Date(1950, 3, 3) - all works well. Thank you anyway! – Timofey Apr 30 '15 at 08:28

1 Answers1

1

Not a problem, Date supports values less than 1970 year

Timofey
  • 141
  • 6