If you represent a calendar date, there is no time or time zone. A short presentation makes more sense.
Unfortunately, the new Date (string) in many javascript implementations may do bad things for you.
new Date('2015-09-23') Tue Sep 22 2015 20:00:00 GMT-0400 (Eastern Daylight Time)
The easiest way out of the problem is not to use javascript Date - this type is the same as DateTimeOffset in other languages. This is a poor way to represent calendar date values.
But you're probably going to use javascript Date anyway. The next simple βfixβ is to avoid standard views (since standard views are interpreted as DateTimeOffset with UTC). Here are two possibilities:
Use "/" instead of "-".
new Date('2015/09/23') Wed Sep 23 2015 00:00:00 GMT-0400 (Eastern Daylight Time)
Use a three-digit month - leading zeros will be discarded.
new Date('2015-009-23') Wed Sep 23 2015 00:00:00 GMT-0400 (Eastern Daylight Time)
If you have client and server side javascript, you're done. If you have something else on the server side, you should think about what the server language will do if it sees non-standard date formats.
Amy b source share