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