#204: fix now button in shift view
This commit is contained in:
parent
fc0d97344e
commit
4998d0f439
|
@ -1,13 +1,10 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function set_to_now(id) {
|
function set_to_now(id) {
|
||||||
var now = new Date();
|
document.getElementById(id + '_time').value = moment().format('HH:mm');
|
||||||
document.getElementById(id + '_time').value = now.getHours() + ':'
|
|
||||||
+ now.getMinutes();
|
|
||||||
var days = document.getElementById(id + '_day').getElementsByTagName(
|
var days = document.getElementById(id + '_day').getElementsByTagName(
|
||||||
'option');
|
'option');
|
||||||
for ( var i = 0; i < days.length; i++) {
|
for ( var i = 0; i < days.length; i++) {
|
||||||
if (days[i].value == (1900 + now.getYear()) + '-'
|
if (days[i].value == moment().format('YYYY-MM-DD'))
|
||||||
+ (1 + now.getMonth()) + '-' + now.getDate())
|
|
||||||
days[i].selected = true;
|
days[i].selected = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue