Skip to content

Commit

Permalink
fix(scheduler-core): consider seconds instead of milliseconds while c…
Browse files Browse the repository at this point in the history
…alculate intervals (#2064)
  • Loading branch information
MaximKudriavtsev committed Jun 6, 2019
1 parent 2b52fe0 commit e2b20a7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/dx-react-scheduler/README.md
@@ -1,7 +1,11 @@
# DevExtreme React Scheduler

Project status: **CTP**

DevExtreme React Scheduler is a component that displays appointments from a local or remote source.

[Website](https://devexpress.github.io/devextreme-reactive/react/scheduler/) | [Demos](https://devexpress.github.io/devextreme-reactive/react/scheduler/demos/) | [Docs](https://devexpress.github.io/devextreme-reactive/react/scheduler/docs/)

## License

[DevExtreme licensing](https://js.devexpress.com/licensing/).
Expand Up @@ -30,6 +30,16 @@ describe('Vertical rect helpers', () => {
.toBe(new Date(2018, 5, 25, 8, 30).toString());
});

it('should consider seconds instead of milliseconds', () => {
const viewCellsData = [
[{
startDate: new Date('2018-06-26 08:00:04:100'), endDate: new Date('2018-06-26 08:30:04'),
}],
];
expect(getCellByDate(viewCellsData, new Date(2018, 5, 26, 8, 0, 4, 50)).index)
.toBe(0);
});

it('should calculate cell index by takePref property', () => {
const viewCellsData = [
[
Expand Down
Expand Up @@ -16,7 +16,7 @@ export const getCellByDate: GetCellByDateFn = (viewCellsData, date, takePrev = f
.isBetween(
timeCell[cellIndex].startDate,
timeCell[cellIndex].endDate,
undefined,
'seconds',
takePrev ? '(]' : '[)'),
);

Expand Down

0 comments on commit e2b20a7

Please sign in to comment.