summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/.index.js.swpbin40960 -> 45056 bytes
-rw-r--r--js/index.js14
2 files changed, 9 insertions, 5 deletions
diff --git a/js/.index.js.swp b/js/.index.js.swp
index 1792131..3a7f14c 100644
--- a/js/.index.js.swp
+++ b/js/.index.js.swp
Binary files differ
diff --git a/js/index.js b/js/index.js
index 13ab09a..0e1b7d6 100644
--- a/js/index.js
+++ b/js/index.js
@@ -140,9 +140,9 @@ function fillform(){
/* benachrichtigt den Benutzer an vdate mit msg */
var notifications = 0;
function addNotification(vdate, msg){
- vdate.subtract('days', $('#notifydayflip').val()); // Bei Bedarf einen Tag vorher
+ vdate = vdate.subtract('days', 1).add('days', $('#notifydayflip').val()); // Bei Bedarf einen Tag vorher
- var secondsUntilDate = moment.diff(vdate, 'seconds');
+ var secondsUntilDate = vdate.diff(moment(), 'seconds');
if(secondsUntilDate > 0){
localNotification.add(++notifications, {
@@ -344,7 +344,11 @@ function renderPage($div, pdf, pageNumber, callback){
var vertretungen = parseVertretungen(page_text, username);
if(vertretungen.length > 0){
- var vdate = moment($div.data('date')).startOf('minute').set('hour', $('#notifydate').val());
+ var vdate = moment($div.data('date'), 'YYYY-MM-DD').startOf('second');
+ var time = $('#notifydate').val().split(':');
+
+ vdate.set('hour', time[0]);
+ vdate.set('minute', time[1]);
addNotification(vdate, vertretungen.join('\n'));
addSocialButton(vdate, vertretungen.join(', '), $div);
@@ -400,7 +404,7 @@ function removelogintab(){
$('#login').remove();
$('#vplantabs').tabs('refresh');
- var vdate = moment($('#vplantabs ul li:first').data('date'));
+ var vdate = moment($('#vplantabs ul li:first').data('date'), 'YYYY-MM-DD');
trackPlan(vdate);
}
@@ -448,7 +452,7 @@ function addplanattr(fileEntry, wasdownloaded){
$('#vplantabs').append('<div id="' + name + '" class="tablist-content"></div>');
$('#vplantabs').tabs('refresh');
- $('#' + name).data('date', vdate.toString());
+ $('#' + name).data('date', results[1]);
if($('#login').length && wasdownloaded){
removelogintab();