UNPKG

@genexus/web-standard-functions

Version:

GeneXus JavaScript standard functions library for web generators

18 lines 552 B
/** * Returns a Date from its parts * @param {GxDate} targetDate * @param {number} year * @param {number} month * @param {number} day * @return Date */ import { EMPTY_DATE_VALUE } from "./core"; export const set = (targetDate, year, month, day) => { targetDate.setFullYear(year, month - 1, day); if (targetDate.getFullYear() !== year || (targetDate.getMonth() !== month - 1 && targetDate.getDate() !== day)) { targetDate.setTime(EMPTY_DATE_VALUE.getTime()); } return targetDate; }; //# sourceMappingURL=set.js.map