From 4a6da547ce8bc6ee08aa795a4b2a203d58c13ac4 Mon Sep 17 00:00:00 2001 From: Ricardo de Almeida Gonzaga Date: Tue, 17 Sep 2013 11:03:45 -0300 Subject: [PATCH] [Time] Fix TZDate constructor Some of the arguments are optional --- time/time_api.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/time/time_api.js b/time/time_api.js index 313aea8..2bbfd53 100644 --- a/time/time_api.js +++ b/time/time_api.js @@ -96,14 +96,17 @@ tizen.TimeDuration.prototype.toString = function() { tizen.TZDate = (function() { var TZDate = function(year, month, day, hours, minutes, seconds, milliseconds, timezone) { var date_; + var hours = hours || 0; + var minutes = minutes || 0; + var seconds = seconds || 0; + var milliseconds = milliseconds || 0; + var timezone_ = timezone || tizen.time.getLocalTimezone(); if (!arguments.length) date_ = new Date(); else date_ = new Date(year, month, day, hours, minutes, seconds, milliseconds); - var timezone_ = timezone || tizen.time.getLocalTimezone(); - var toTimezone = function(timezone) { return new TZDate(date_.getFullYear(), date_.getMonth(), date_.getDate(), date_.getHours(), date_.getMinutes(), -- 2.7.4