From: Jan Schneider Date: Tue, 1 Jun 2010 17:06:45 +0000 (+0200) Subject: Round to the nearest half hour when clicking in day/week views to create new events.. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f7a6ad3a9c70bcd45a0cfb83e868fbc7e8dab6bf;p=horde.git Round to the nearest half hour when clicking in day/week views to create new events.. --- diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 1656814bb..873be90a6 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -3924,7 +3924,7 @@ KronolithCore = { case 'kronolithEventsDay': date = this.date.clone(); - date.add((e.pointerY() - elt.cumulativeOffset().top) / this.daySizes.height * 60).minutes(); + date.add(Math.round((e.pointerY() - elt.cumulativeOffset().top) / this.daySizes.height * 2) * 30).minutes(); this.go('event:' + date.toString('yyyyMMddHHmm')); e.stop(); return; @@ -4097,7 +4097,7 @@ KronolithCore = { date += 'all'; } else { date = this.parseDate(date); - date.add((e.pointerY() - elt.cumulativeOffset().top) / this.weekSizes.height * 60).minutes(); + date.add(Math.round((e.pointerY() - elt.cumulativeOffset().top) / this.weekSizes.height * 2) * 30).minutes(); date = date.toString('yyyyMMddHHmm'); } this.go('event:' + date);