mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-09-17 03:18:01 +00:00
fix(calendar(js)): swap start-end dates when delta is negative
When creating an event by drag'n'dropping from bottom to top, the original coordinate become the start date.
This commit is contained in:
@@ -759,6 +759,13 @@
|
||||
* @param {number} delta - the number of minutes
|
||||
*/
|
||||
Component.prototype.setDelta = function(delta) {
|
||||
if (delta < 0) {
|
||||
var start = new Date(this.start.getTime());
|
||||
start.setMinutes(Math.round(start.getMinutes()/15)*15);
|
||||
start.addMinutes(delta);
|
||||
this.start = start;
|
||||
delta *= -1;
|
||||
}
|
||||
this.delta = delta;
|
||||
this.end = new Date(this.start.getTime());
|
||||
this.end.setMinutes(Math.round(this.end.getMinutes()/15)*15);
|
||||
|
||||
Reference in New Issue
Block a user