From b63f7a74162c82adf7dbda8fbc2896d305e3df89 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Tue, 19 Nov 2013 12:14:37 +0000 Subject: [PATCH] Fix missing seconds in serialised date fields --- boot/boot.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/boot/boot.js b/boot/boot.js index 5b7edd7a7..7f3aaa1b2 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -225,17 +225,18 @@ $tw.utils.pad = function(value,length) { return s; }; -// Convert a date into UTC YYYYMMDDHHMM format +// Convert a date into UTC YYYYMMDDHHMMSSmmm format $tw.utils.stringifyDate = function(value) { return value.getUTCFullYear() + $tw.utils.pad(value.getUTCMonth() + 1) + $tw.utils.pad(value.getUTCDate()) + $tw.utils.pad(value.getUTCHours()) + $tw.utils.pad(value.getUTCMinutes()) + + $tw.utils.pad(value.getUTCSeconds()) + $tw.utils.pad(value.getUTCMilliseconds(),3); }; -// Parse a date from a UTC YYYYMMDDHHMMSSMMM format string +// Parse a date from a UTC YYYYMMDDHHMMSSmmm format string $tw.utils.parseDate = function(value) { if(typeof value === "string") { return new Date(Date.UTC(parseInt(value.substr(0,4),10),