MCPcopy Create free account
hub / github.com/UI5/webcomponents / createUTCDate

Function createUTCDate

packages/localization/src/dates/CalendarDate.ts:207–213  ·  view source on GitHub ↗

* Creates a JavaScript UTC Date corresponding to the given JavaScript Date. * @param {Date} oDate JavaScript date object. Time related information is cut. * @returns {Date} JavaScript date created from the date object, but this time considered as UTC date information.

(oDate: UI5Date | Date)

Source from the content-addressed store, hash-verified

205 * @returns {Date} JavaScript date created from the date object, but this time considered as UTC date information.
206 */
207function createUTCDate(oDate: UI5Date | Date) {
208 const oUTCDate = new Date(Date.UTC(0, 0, 1)); // no need to replace with UI5Date as we are creating a new UTC date object
209
210 oUTCDate.setUTCFullYear(oDate.getFullYear(), oDate.getMonth(), oDate.getDate());
211
212 return oUTCDate;
213}
214
215function checkCalendarDate(oCalendarDate: CalendarDate) {
216 if (!(oCalendarDate instanceof CalendarDate)) {

Callers 1

createUniversalUTCDateFunction · 0.85

Calls 2

getMonthMethod · 0.80
getDateMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…