You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found a few time in order to fix it and i came with the following modification:
Line 187 options.beforeDateTime = Math.round((new Date(options.beforeDateTime)).getTime()/1000);
I placed for a test...
if(options.tzoneOffset){
//get current local time
var tmp = new Date(options.beforeDateTime).getTime();
//get current local time offset
var localoffset = new Date(options.beforeDateTime).getTimezoneOffset();
//find the difference between offsets
var offsetdif = ( (options.tzoneOffset * 60) + localoffset ) / 60;
//place the date in a var
tmp = (new Date(options.beforeDateTime)).getTime() - 3600000 * (offsetdif)
options.beforeDateTime = Math.round(tmp/1000);
}else{
options.beforeDateTime = Math.round((new Date(options.beforeDateTime)).getTime()/1000);
}
This covers the string and not the object case of course... but is is something :)
Unfortunately there is no easy way in javascript to convert a date into specific timezoneoffset.
Thank you for your time!
Edit: 6-10-2015.
The text was updated successfully, but these errors were encountered:
Hello,
I can you please check, support the option tzoneOffset along beforeDateTime.
Currently these two scripts show the exact same time.
$('#retroclockbox1').flipcountdown({
beforeDateTime:'10/20/2015 11:00:00',
tzoneOffset: 2
});
$('#retroclockbox2').flipcountdown({
beforeDateTime:'10/20/2015 11:00:00',
tzoneOffset: 3
});
I found a few time in order to fix it and i came with the following modification:
Line 187 options.beforeDateTime = Math.round((new Date(options.beforeDateTime)).getTime()/1000);
I placed for a test...
if(options.tzoneOffset){
//get current local time
var tmp = new Date(options.beforeDateTime).getTime();
//get current local time offset
var localoffset = new Date(options.beforeDateTime).getTimezoneOffset();
//find the difference between offsets
var offsetdif = ( (options.tzoneOffset * 60) + localoffset ) / 60;
//place the date in a var
tmp = (new Date(options.beforeDateTime)).getTime() - 3600000 * (offsetdif)
options.beforeDateTime = Math.round(tmp/1000);
}else{
options.beforeDateTime = Math.round((new Date(options.beforeDateTime)).getTime()/1000);
}
This covers the string and not the object case of course... but is is something :)
Unfortunately there is no easy way in javascript to convert a date into specific timezoneoffset.
Thank you for your time!
Edit: 6-10-2015.
The text was updated successfully, but these errors were encountered: