Check if a date is less than or equal today

		/** 
		 * @description Check if the oData is less than or equal today. To be able to check the date the hours must be set to 0.
		 * @param {object} oDate - Date to check
		 * @returns {boolean} - Date is less than today Y/N
		 */
		checkIfDateIsLessThanOrEqualToday: function(oDate) {
			var bLessThanToday = false,
				iDate = oDate.setHours(0, 0, 0, 0),
				iToday = new Date().setHours(0, 0, 0, 0);

			if (iDate <= iToday) {
				bLessThanToday = true;
			}

			return bLessThanToday;
		}

Related Information

Leave a Reply

Your email address will not be published. Required fields are marked *