mirror of
https://github.com/magicbug/Cloudlog
synced 2024-11-22 00:07:14 +00:00
Adapt contest logging
This commit is contained in:
parent
5368ef25f3
commit
e0c35aa0cf
@ -68,19 +68,11 @@ function setSession(formdata) {
|
|||||||
// realtime clock
|
// realtime clock
|
||||||
if ( ! manual ) {
|
if ( ! manual ) {
|
||||||
$(function ($) {
|
$(function ($) {
|
||||||
var options = {
|
handleStart = setInterval(function() { getUTCTimeStamp($('.input_time')); }, 500);
|
||||||
utc: true,
|
|
||||||
format: '%H:%M:%S'
|
|
||||||
}
|
|
||||||
$('.input_time').jclock(options);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(function ($) {
|
$(function ($) {
|
||||||
var options = {
|
handleDate = setInterval(function() { getUTCDateStamp($('.input_date')); }, 1000);
|
||||||
utc: true,
|
|
||||||
format: '%d-%m-%Y'
|
|
||||||
}
|
|
||||||
$('.input_date').jclock(options);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -572,3 +564,17 @@ function pad (str, max) {
|
|||||||
str = str.toString();
|
str = str.toString();
|
||||||
return str.length < max ? pad("0" + str, max) : str;
|
return str.length < max ? pad("0" + str, max) : str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getUTCTimeStamp(el) {
|
||||||
|
var now = new Date();
|
||||||
|
var localTime = now.getTime();
|
||||||
|
var utc = localTime + (now.getTimezoneOffset() * 60000);
|
||||||
|
$(el).attr('value', ("0" + now.getUTCHours()).slice(-2)+':'+("0" + now.getUTCMinutes()).slice(-2)+':'+("0" + now.getUTCSeconds()).slice(-2));
|
||||||
|
}
|
||||||
|
|
||||||
|
function getUTCDateStamp(el) {
|
||||||
|
var now = new Date();
|
||||||
|
var localTime = now.getTime();
|
||||||
|
var utc = localTime + (now.getTimezoneOffset() * 60000);
|
||||||
|
$(el).attr('value', ("0" + now.getUTCDate()).slice(-2)+'-'+("0" + (now.getUTCMonth()+1)).slice(-2)+'-'+now.getUTCFullYear());
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user