datatype-date-math-debug.js revision 79cf858565f2b256d816b50edb025ff71589dcc0
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * Datatype Date Math submodule.
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @module datatype
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @submodule datatype-date-math
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @for DataType.Date
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * Checks whether a native JavaScript Date contains a valid value.
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @for DataType.Date
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @method isValidDate
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @param oDate {Date} Date in the month for which the number of days is desired.
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @return {Boolean} True if the date argument contains a valid value.
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly if(LANG.isDate(oDate) && (isFinite(oDate)) && (oDate != "Invalid Date") && !isNaN(oDate) && (oDate != null)) {
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly Y.log("Could not validate data " + LANG.dump(oDate) + " as type Date", "warn", "date");
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly return false;
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * Checks whether two dates correspond to the same date and time.
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @for DataType.Date
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @method areEqual
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @param aDate {Date} The first date to compare.
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @param bDate {Date} The second date to compare.
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * @return {Boolean} True if the two dates correspond to the same
8f9d94fb7812612dff92ce14a37dbcad4ff02c1cJenny Donnelly * date and time.
return (this.isValidDate(aDate) && this.isValidDate(bDate) && (aDate.getTime() == bDate.getTime()));
return (this.isValidDate(aDate) && this.isValidDate(bDate) && (aDate.getTime() >= bDate.getTime()));
return newDate;
return newDate;
output = [];
return output;