From bfe34d92b5675b236af581ddb7e0bf77f213f268 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Sun, 15 Mar 2015 14:48:16 -0700 Subject: [PATCH] polyfill Date.now for old browsers --- strftime.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/strftime.js b/strftime.js index 00c877a..5d45d8d 100644 --- a/strftime.js +++ b/strftime.js @@ -85,6 +85,13 @@ }; // End of deprecated API + // Polyfill Date.now for old browsers. + if (typeof Date.now !== 'function') { + Date.now = function() { + return +new Date(); + }; + } + function Strftime(locale, customTimezoneOffset, useUtcTimezone) { var _locale = locale || DefaultLocale, _customTimezoneOffset = customTimezoneOffset || 0,