mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-22 16:26:08 +08:00
fix(scheduler): can scheduler on 30 min intervals
This commit is contained in:
parent
544eacd87e
commit
d4de652dab
|
@ -50,8 +50,7 @@ class ProposedTimeCalendarStore extends NylasStore {
|
||||||
|
|
||||||
timeBlocks() {
|
timeBlocks() {
|
||||||
return _.groupBy(this._proposedTimes, (t) => {
|
return _.groupBy(this._proposedTimes, (t) => {
|
||||||
const blockSize = this._duration.slice(0, 2)
|
return moment(t).floor(30, 'minutes').valueOf()
|
||||||
return moment(t).floor(blockSize[0], blockSize[1]).valueOf()
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,11 +83,10 @@ class ProposedTimeCalendarStore extends NylasStore {
|
||||||
this.trigger()
|
this.trigger()
|
||||||
}
|
}
|
||||||
|
|
||||||
_onRemoveProposedTime = ({start, end}) => {
|
_onRemoveProposedTime = ({start}) => {
|
||||||
const startInt = parseInt(start, 10);
|
const startInt = parseInt(start, 10);
|
||||||
const endInt = parseInt(end, 10);
|
|
||||||
this._proposedTimes = _.filter(this._proposedTimes, (p) =>
|
this._proposedTimes = _.filter(this._proposedTimes, (p) =>
|
||||||
p.unix() < startInt || p.unix() > endInt
|
p.unix() < startInt || p.unix() > startInt + (30 * 60)
|
||||||
)
|
)
|
||||||
this.trigger()
|
this.trigger()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue