fix(scheduler): can scheduler on 30 min intervals

This commit is contained in:
Evan Morikawa 2016-04-06 14:09:51 -07:00
parent 544eacd87e
commit d4de652dab

View file

@ -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()
}