mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-25 08:35:16 +08:00
fix(scheduler): Don't cast durations to integers, fix 1.5, 2.5 hour blocks
This commit is contained in:
parent
5f75cccc0f
commit
c69b192881
1 changed files with 6 additions and 4 deletions
|
@ -97,7 +97,7 @@ class ProposedTimeCalendarStore extends NylasStore {
|
||||||
)
|
)
|
||||||
|
|
||||||
const blockSize = this._duration.slice(0, 2)
|
const blockSize = this._duration.slice(0, 2)
|
||||||
blockSize[0] = parseInt(blockSize[0], 10);
|
blockSize[0] = blockSize[0] / 1; // moment requires a number
|
||||||
const isMinBlockSize = (bounds.end - bounds.start) >= moment.duration.apply(moment, blockSize).as('seconds');
|
const isMinBlockSize = (bounds.end - bounds.start) >= moment.duration.apply(moment, blockSize).as('seconds');
|
||||||
while (minMoment.isSameOrBefore(maxMoment)) {
|
while (minMoment.isSameOrBefore(maxMoment)) {
|
||||||
const start = minMoment.unix();
|
const start = minMoment.unix();
|
||||||
|
@ -138,9 +138,11 @@ class ProposedTimeCalendarStore extends NylasStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
_onEndBlock = () => {
|
_onEndBlock = () => {
|
||||||
this._convertBufferToProposedTimes()
|
if (this._dragBuffer.anchor) {
|
||||||
this._resetDragBuffer();
|
this._convertBufferToProposedTimes()
|
||||||
this.trigger()
|
this._resetDragBuffer();
|
||||||
|
this.trigger();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_onChangeDuration = (newDuration) => {
|
_onChangeDuration = (newDuration) => {
|
||||||
|
|
Loading…
Reference in a new issue