'use strict';
var PresentationDate = (function () {
function PresentationDate() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i - 0] = arguments[_i];
}
// Builds a Date from any arguments passed in, or a new Date if none.
// Note that invalid arguments for this constructor will result in an invalid date, just the same as if
// passed to the Date constructor directly.
this.localDate = args.length ? new (Function.prototype.bind.apply(Date, [null].concat(args))) : new Date();
}
PresentationDate.prototype.isValid = function () {
return !isNaN(this.localDate.valueOf());
};
PresentationDate.prototype.toDate = function () {
// Returns a Date, which contains the date value of the current localDate, with no time component, in UTC,
// or if the current date is invalid, undefined.
// For example, if the current localDate is "Wed Sep 09 2015 16:35:41 GMT-0500 (Central Daylight Time)",
// this will return "Tue Sep 08 2015 19:00:00 GMT-0500 (Central Daylight Time)", which translated to UTC is
// "2015-09-09T00:00:00.000Z".
if (!this.isValid()) {
return;
}
return new Date(Date.UTC(this.localDate.getFullYear(), this.localDate.getMonth(), this.localDate.getDate()));
};
PresentationDate.getNumberOfDaysInMonth = function (year, month) {
var lastDay = new Date(year, month + 1, 0);
return lastDay.getDate();
};
PresentationDate.prototype.numberOfDaysInMonth = function () {
return...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.