summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2015-08-14 13:10:13 +0200
committerPhilip Häusler <msquare@notrademark.de>2015-08-14 13:10:13 +0200
commit4998d0f439528f4bb80d827dea8676d409fd1846 (patch)
treef7890f5f22193569a5cec263607a65966553cbf1 /templates
parentfc0d97344eb73c12709c3d702df8598daf9e9111 (diff)
#204: fix now button in shift view
Diffstat (limited to 'templates')
-rw-r--r--templates/user_shifts.html7
1 files changed, 2 insertions, 5 deletions
diff --git a/templates/user_shifts.html b/templates/user_shifts.html
index 153af7ee..b5762271 100644
--- a/templates/user_shifts.html
+++ b/templates/user_shifts.html
@@ -1,13 +1,10 @@
<script type="text/javascript">
function set_to_now(id) {
- var now = new Date();
- document.getElementById(id + '_time').value = now.getHours() + ':'
- + now.getMinutes();
+ document.getElementById(id + '_time').value = moment().format('HH:mm');
var days = document.getElementById(id + '_day').getElementsByTagName(
'option');
for ( var i = 0; i < days.length; i++) {
- if (days[i].value == (1900 + now.getYear()) + '-'
- + (1 + now.getMonth()) + '-' + now.getDate())
+ if (days[i].value == moment().format('YYYY-MM-DD'))
days[i].selected = true;
}
}