From feefadb125770c0a513735ba7b3d6bea78c77d3b Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Fri, 28 Oct 2011 07:46:36 -0400 Subject: Fixes #4012 when using a timestamp with input/date, return UTC time rather than local time --- js/lib/ui.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/lib/ui.js b/js/lib/ui.js index 166ca16bc..6cc1bc78a 100644 --- a/js/lib/ui.js +++ b/js/lib/ui.js @@ -267,8 +267,8 @@ elgg.ui.initDatePicker = function() { onSelect: function(dateText) { if ($(this).is('.elgg-input-timestamp')) { // convert to unix timestamp - var date = $.datepicker.parseDate('yy-mm-dd', dateText); - var timestamp = $.datepicker.formatDate('@', date); + var dateParts = dateText.split("-"); + var timestamp = Date.UTC(dateParts[0], dateParts[1] - 1, dateParts[2]); timestamp = timestamp / 1000; var id = $(this).attr('id'); -- cgit v1.2.3