You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Create a {@link Date} object from the given standard JavaScript `Date`.
355
-
* Hour, minute, second, millisecond and time zone offset components of the given date are ignored.
355
+
* Hour, minute, secondand millisecond components of the given date are ignored.
356
356
*
357
-
* NOTE: the function {@link toStandardDate} and {@link fromStandardDate} are not inverses of one another. {@link fromStandardDate} takes the Day, Month and Year in local time from the supplies JavaScript Date object, while {@link toStandardDate} creates a new JavaScript Date object at midnight UTC. This incongruity will be rectified in 6.0
357
+
* NOTE: the function {@link toStandardDate} and {@link fromStandardDate} are not inverses of one another. {@link fromStandardDate} takes the Day, Month and Year in local time from the supplied JavaScript Date object, while {@link toStandardDate} creates a new JavaScript Date object at midnight UTC. This incongruity will be rectified in 6.0
358
358
* If your timezone has a negative offset from UTC, creating a JavaScript Date at midnight UTC and converting it with {@link fromStandardDate} will result in a Date for the day before.
359
359
*
360
360
* @param {global.Date} standardDate - The standard JavaScript date to convert.
361
361
* @return {Date} New Date.
362
+
* @deprecated use {@link fromStandardDateLocal} which is a drop in replacement, or {@link fromStandardDateUTC} which takes the Year, Month and Date from UTC rather than Local time
* Create a {@link Date} object from the given standard JavaScript `Date` using the Year, Month and Date in Local Time.
370
+
* Hour, minute, second and millisecond components of the given date are ignored.
371
+
*
372
+
* NOTE: this function and {@link toStandardDate} are not inverses of one another.
373
+
* This takes the Day, Month and Year in local time from the supplied JavaScript Date object, while {@link toStandardDate} creates a new JavaScript Date object at midnight UTC.
374
+
* For a more global approach, use {@link fromStandardDateUTC}, which reads the date in UTC time.
375
+
*
376
+
* @example
377
+
* fromStandardDateLocal(new Date("2010-10-10T00:00:00")) // Will create a date at 2010-10-10 as JS Dates are created at local time by default
378
+
* fromStandardDateLocal(new Date("2010-10-10T00:00:00Z")) // This may cause issues as this date is created at UTC with the trailing "Z"
379
+
*
380
+
* @param {global.Date} standardDate - The standard JavaScript date to convert.
* The time component of the returned `Date` is set to midnight
377
418
* and the time zone is set to UTC.
378
419
*
379
-
* NOTE: the function {@link toStandardDate} and {@link fromStandardDate} are not inverses of one another. {@link fromStandardDate} takes the Day, Month and Year in local time from the supplies JavaScript Date object, while {@link toStandardDate} creates a new JavaScript Date object at midnight UTC. This incongruity will be rectified in 6.0
380
-
*
381
420
* @returns {StandardDate} Standard JavaScript `Date` at `00:00:00.000` UTC.
0 commit comments