Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
Update stories to not use moment directly
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoernricks authored and timopollmeier committed Jun 26, 2018
1 parent 3ca0410 commit ebc5e7b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
7 changes: 3 additions & 4 deletions ng/src/web/stories/chart/line.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
*/
import React from 'react';

import moment from 'moment';

import {longDate} from 'gmp/locale/date';

import date from 'gmp/models/date';

import {storiesOf} from '@storybook/react';
import {action} from '@storybook/addon-actions';

Expand Down Expand Up @@ -54,7 +54,6 @@ const linedata = [{
},
];


storiesOf('Chart/Line', module)
.add('default', () => {
return (
Expand Down Expand Up @@ -125,7 +124,7 @@ storiesOf('Chart/Line', module)
);
})
.add('timeline', () => {
const start = moment().subtract(2, 'year');
const start = date().subtract(2, 'year');
const dates = [
start,
start.clone().add(1, 'year'),
Expand Down
14 changes: 7 additions & 7 deletions ng/src/web/stories/chart/schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
import React from 'react';

import moment from 'moment';
import date from 'gmp/models/date';

import {storiesOf} from '@storybook/react';

Expand All @@ -35,30 +35,30 @@ const SEVEN_HOURS = 60 * 60 * 7;

const data = [{
label: 'Foo',
start: moment().add(1, 'day'),
start: date().add(1, 'day'),
duration: ONE_DAY,
}, {
label: 'Bar',
start: moment().add(2, 'day'),
start: date().add(2, 'day'),
period: ONE_WEEK,
}, {
label: 'Lorem',
start: moment().add(4, 'hours'),
start: date().add(4, 'hours'),
period: TWO_DAYS,
periods: 4,
duration: ONE_DAY,
}, {
label: 'Ipsum',
start: moment().add(2, 'day').add(4, 'hours'),
start: date().add(2, 'day').add(4, 'hours'),
period: SEVEN_HOURS,
}, {
label: 'Dolor',
start: moment().add(3, 'day').add(4, 'hours'),
start: date().add(3, 'day').add(4, 'hours'),
period: ONE_WEEK,
periods: 2,
}, {
label: 'Sit',
start: moment().add(1, 'day').add(4, 'hours'),
start: date().add(1, 'day').add(4, 'hours'),
period: 0,
periods: 0,
periodMonth: 2,
Expand Down
7 changes: 4 additions & 3 deletions ng/src/web/stories/datepicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@

import React from 'react';
import glamorous from 'glamorous';
import moment from 'moment';

import date from 'gmp/models/date';

import {storiesOf} from '@storybook/react';

import PropTypes from '../../utils/proptypes.js';

import DatePicker from 'web/components/form/datepicker.js';

const today = moment();
const testdate = moment('2018-10-10');
const today = date();
const testdate = date('2018-10-10');

class ControlledDatePicker extends React.Component {

Expand Down

0 comments on commit ebc5e7b

Please sign in to comment.