diff --git a/dist/angular-clock.js b/dist/angular-clock.js index 390edfd..965f53d 100644 --- a/dist/angular-clock.js +++ b/dist/angular-clock.js @@ -152,7 +152,7 @@ convert to msec add local time zone offset get UTC time in msec*/ - var utc = now.getTime() + (now.getTimezoneOffset() * 60000); + var utc = now.getTime() + (now.getTimezoneOffset() * 3600000); // create new Date object for different city // using supplied offset var offsetNow = new Date(utc + (3600000 * o.gmtOffset)); diff --git a/dist/angular-clock.min.js b/dist/angular-clock.min.js index 9bcd335..d8e12cb 100644 --- a/dist/angular-clock.min.js +++ b/dist/angular-clock.min.js @@ -1,2 +1,2 @@ -!function(){"use strict";function t(t,n){return{restrict:"EA",scope:{gmtOffset:"=gmtOffset",digitalFormat:"=digitalFormat",showDigital:"=showDigital",showAnalog:"=showAnalog",startTime:"=startTime",theme:"=theme"},template:'
{{digital}}
{{gmtInfo}}
',link:function(s,r,l){var g,m={},c=s.gmtOffset,f=s.digitalFormat?s.digitalFormat:"HH:mm:ss";m.showDigital=null!=s.showDigital?s.showDigital:void 0!==l.showDigital?!0:!1,m.showAnalog=null!=s.showAnalog?s.showAnalog:void 0!==l.showAnalog?!0:!1,m.showGmtInfo=void 0!==l.showGmtInfo?!0:!1,m.startTime=parseInt(s.startTime,10),s.themeClass=s.theme?s.theme:l.theme?l.theme:"light",m.showDigital||m.showAnalog||(m.showAnalog=!0,m.showDigital=!0),s.gmtInfo=!1,s.date=i(m),s.digital=m.showDigital?"Loading..":!1,s.analog=m.showAnalog,s.majors=new Array(12),s.minors=new Array(60);var h=null,d=function(){isNaN(m.startTime)||(m.startTime=m.startTime+1e3),h=i(m),s.date=h,m.showDigital&&(s.digital=o(h,f,c,n))};g=t(d,1e3),s.$watch("gmtOffset",function(t){c=t,m.gmtOffset=null!=c?a(c):!1,m.showGmtInfo&&m.gmtOffset!==!1&&(s.gmtInfo=e(m.gmtOffset)),d()}),s.$watch("digitalFormat",function(t,a){t!=a&&(f=t)}),s.$watch("showDigital",function(t,a){t!=a&&(m.showDigital=t,s.digital=m.showDigital?"Loading..":!1)}),s.$watch("showAnalog",function(t,a){t!=a&&(m.showAnalog=t,s.analog=t)}),s.$watch("theme",function(t,a){t!=a&&(s.themeClass=t?t:l.theme?l.theme:"light")}),r.on("$destroy",function(){t.cancel(g),g=null})}}}function a(t){t=parseFloat(t);var a=t>0?Math.floor(t):Math.ceil(t),e=t%1/.6;return a+e}function e(t){var a=t>0?Math.floor(t):Math.ceil(t),e=Math.round((t>0?t:-1*t)%1*60);return"GMT"+(0===t?"":(t>0?" +":" ")+n(a)+"."+s(e).substring(0,2))}function n(t){return 0>t?(t>-10?"-0":"-")+-1*t:(10>t?"0":"")+t}function s(t){return t+(10>t?"0":"")}function i(t){var a=isNaN(t.startTime)?new Date:new Date(t.startTime);if(null!==t.gmtOffset&&t.gmtOffset!==!1){var e=a.getTime()+6e4*a.getTimezoneOffset(),n=new Date(e+36e5*t.gmtOffset);return{hrs:n.getHours(),mins:n.getMinutes(),secs:n.getSeconds(),date:n}}return{hrs:a.getHours(),mins:a.getMinutes(),secs:a.getSeconds(),date:a}}function o(t,a,e,n){return n("date")(t.date,a,e)}angular.module("ds.clock",[]).directive("dsWidgetClock",["$interval","$filter",function(a,e){return t(a,e)}])}(); -//# sourceMappingURL=angular-clock.min.js.map \ No newline at end of file +!function(){"use strict";function t(t,n){return{restrict:"EA",scope:{gmtOffset:"=gmtOffset",digitalFormat:"=digitalFormat",showDigital:"=showDigital",showAnalog:"=showAnalog",startTime:"=startTime",theme:"=theme"},template:'
{{digital}}
{{gmtInfo}}
',link:function(s,r,l){var g,m={},c=s.gmtOffset,f=s.digitalFormat?s.digitalFormat:"HH:mm:ss";m.showDigital=null!=s.showDigital?s.showDigital:void 0!==l.showDigital?!0:!1,m.showAnalog=null!=s.showAnalog?s.showAnalog:void 0!==l.showAnalog?!0:!1,m.showGmtInfo=void 0!==l.showGmtInfo?!0:!1,m.startTime=parseInt(s.startTime,10),s.themeClass=s.theme?s.theme:l.theme?l.theme:"light",m.showDigital||m.showAnalog||(m.showAnalog=!0,m.showDigital=!0),s.gmtInfo=!1,s.date=i(m),s.digital=m.showDigital?"Loading..":!1,s.analog=m.showAnalog,s.majors=new Array(12),s.minors=new Array(60);var h=null,d=function(){isNaN(m.startTime)||(m.startTime=m.startTime+1e3),h=i(m),s.date=h,m.showDigital&&(s.digital=o(h,f,c,n))};g=t(d,1e3),s.$watch("gmtOffset",function(t){c=t,m.gmtOffset=null!=c?a(c):!1,m.showGmtInfo&&m.gmtOffset!==!1&&(s.gmtInfo=e(m.gmtOffset)),d()}),s.$watch("digitalFormat",function(t,a){t!=a&&(f=t)}),s.$watch("showDigital",function(t,a){t!=a&&(m.showDigital=t,s.digital=m.showDigital?"Loading..":!1)}),s.$watch("showAnalog",function(t,a){t!=a&&(m.showAnalog=t,s.analog=t)}),s.$watch("theme",function(t,a){t!=a&&(s.themeClass=t?t:l.theme?l.theme:"light")}),r.on("$destroy",function(){t.cancel(g),g=null})}}}function a(t){t=parseFloat(t);var a=t>0?Math.floor(t):Math.ceil(t),e=t%1/.6;return a+e}function e(t){var a=t>0?Math.floor(t):Math.ceil(t),e=Math.round((t>0?t:-1*t)%1*60);return"GMT"+(0===t?"":(t>0?" +":" ")+n(a)+"."+s(e).substring(0,2))}function n(t){return 0>t?(t>-10?"-0":"-")+-1*t:(10>t?"0":"")+t}function s(t){return t+(10>t?"0":"")}function i(t){var a=isNaN(t.startTime)?new Date:new Date(t.startTime);if(null!==t.gmtOffset&&t.gmtOffset!==!1){var e=a.getTime()+36e5*a.getTimezoneOffset(),n=new Date(e+36e5*t.gmtOffset);return{hrs:n.getHours(),mins:n.getMinutes(),secs:n.getSeconds(),date:n}}return{hrs:a.getHours(),mins:a.getMinutes(),secs:a.getSeconds(),date:a}}function o(t,a,e,n){return n("date")(t.date,a,e)}angular.module("ds.clock",[]).directive("dsWidgetClock",["$interval","$filter",function(a,e){return t(a,e)}])}(); +//# sourceMappingURL=angular-clock.min.js.map