var econda; (function (econda) { var util; (function (util) { /** * Simple date helpers * @class econda.util.DateUtils * @static */ var DateUtils = (function () { function DateUtils() { } /** * Check if given object is a date * @param {Mixed} obj Object to check * @returns {Boolean} */ DateUtils.isDate = function (obj) { return '[object Date]' == Object.prototype.toString.call(obj); }; /** * Converts a date object to an iso string, e.g. 2015-11-26T16:18:56 */ DateUtils.toUtcIsoString = function (date) { function pad(number) { if (number < 10) { return '0' + number; } return '' + number; } if (date instanceof Date) { return date.getUTCFullYear() + '-' + pad(date.getUTCMonth() + 1) + '-' + pad(date.getUTCDate()) + 'T' + pad(date.getUTCHours()) + ':' + pad(date.getUTCMinutes()) + ':' + pad(date.getUTCSeconds()) + 'Z'; } return null; }; return DateUtils; }()); util.DateUtils = DateUtils; // end of class })(util = econda.util || (econda.util = {})); })(econda || (econda = {})); // end of module