Search code examples
node.jssails.jswaterlinesails-postgresql

Is there some way to overwrite default formatting and validation for specific type?


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?


Solution

  • Not a problem, Date supports values less than 1970 year