Skip to content

Commit

Permalink
replace moment by moment-timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
hbruch committed Jan 17, 2024
1 parent 2a6723a commit c4e9c35
Show file tree
Hide file tree
Showing 54 changed files with 55 additions and 55 deletions.
2 changes: 1 addition & 1 deletion app/component/AirportCheckInLeg.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PropTypes from 'prop-types';
import React from 'react';
import { FormattedMessage, intlShape } from 'react-intl';
import moment from 'moment';
import moment from 'moment-timezone';
import { Link } from 'found';
import ItineraryCircleLine from './ItineraryCircleLine';
import Icon from './Icon';
Expand Down
2 changes: 1 addition & 1 deletion app/component/BikeParkLeg.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PropTypes from 'prop-types';
import cx from 'classnames';
import React from 'react';
import moment from 'moment';
import moment from 'moment-timezone';
import { Link } from 'found';
import { FormattedMessage, intlShape } from 'react-intl';
import { displayDistance } from '../util/geo-utils';
Expand Down
2 changes: 1 addition & 1 deletion app/component/CarLeg.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from 'prop-types';
import React from 'react';
import moment from 'moment';
import moment from 'moment-timezone';
import { FormattedMessage, intlShape } from 'react-intl';

import Icon from './Icon';
Expand Down
2 changes: 1 addition & 1 deletion app/component/CarParkLeg.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from 'prop-types';
import React from 'react';
import moment from 'moment';
import moment from 'moment-timezone';
import { FormattedMessage, intlShape } from 'react-intl';
import cx from 'classnames';

Expand Down
2 changes: 1 addition & 1 deletion app/component/CarpoolLeg.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from 'prop-types';
import { FormattedMessage, intlShape } from 'react-intl';
import moment from 'moment';
import moment from 'moment-timezone';
import React from 'react';
import cx from 'classnames';
import { displayDistance } from '../util/geo-utils';
Expand Down
2 changes: 1 addition & 1 deletion app/component/DelayedTime.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import cx from 'classnames';
import moment from 'moment';
import moment from 'moment-timezone';
import React from 'react';
import PropTypes from 'prop-types';
import { legHasCancelation } from '../util/alertUtils';
Expand Down
2 changes: 1 addition & 1 deletion app/component/DepartureRow.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import moment from 'moment';
import moment from 'moment-timezone';
import { intlShape } from 'react-intl';
import { v4 as uuid } from 'uuid';
import { Link } from 'found';
Expand Down
2 changes: 1 addition & 1 deletion app/component/LocalTime.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import moment from 'moment';
import moment from 'moment-timezone';
import PropTypes from 'prop-types';

const LocalTime = ({ forceUtc, time }) => {
Expand Down
2 changes: 1 addition & 1 deletion app/component/RouteAlertsRow.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable jsx-a11y/no-noninteractive-tabindex */
import cx from 'classnames';
import capitalize from 'lodash/capitalize';
import moment from 'moment';
import moment from 'moment-timezone';
import PropTypes from 'prop-types';
import React from 'react';
import { intlShape } from 'react-intl';
Expand Down
2 changes: 1 addition & 1 deletion app/component/RouteScheduleContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
import React, { PureComponent } from 'react';
import { createFragmentContainer, graphql } from 'react-relay';
import { matchShape, routerShape, RedirectException } from 'found';
import moment from 'moment';
import moment from 'moment-timezone';
import { intlShape, FormattedMessage } from 'react-intl';
import sortBy from 'lodash/sortBy';
import cx from 'classnames';
Expand Down
2 changes: 1 addition & 1 deletion app/component/RouteStopListContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import groupBy from 'lodash/groupBy';
import values from 'lodash/values';
import cx from 'classnames';
import { FormattedMessage } from 'react-intl';
import moment from 'moment';
import moment from 'moment-timezone';

import RouteStop from './RouteStop';
import withBreakpoint from '../util/withBreakpoint';
Expand Down
2 changes: 1 addition & 1 deletion app/component/StopTimetablePage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { createRefetchContainer, graphql } from 'react-relay';
import moment from 'moment';
import moment from 'moment-timezone';

import { matchShape, routerShape } from 'found';
import { prepareServiceDay } from '../util/dateParamUtils';
Expand Down
2 changes: 1 addition & 1 deletion app/component/SummaryPlanContainer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-nested-ternary */
import connectToStores from 'fluxible-addons-react/connectToStores';
import moment from 'moment';
import moment from 'moment-timezone';
import PropTypes from 'prop-types';
import React from 'react';
import {
Expand Down
2 changes: 1 addition & 1 deletion app/component/TerminalTimetablePage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { createRefetchContainer, graphql } from 'react-relay';
import moment from 'moment';
import moment from 'moment-timezone';

import { matchShape, routerShape } from 'found';
import { prepareServiceDay } from '../util/dateParamUtils';
Expand Down
2 changes: 1 addition & 1 deletion app/component/TicketInformation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react';
import { FormattedMessage, FormattedHTMLMessage, intlShape } from 'react-intl';

import { v4 as uuid } from 'uuid';
import Moment from 'moment';
import Moment from 'moment-timezone';
import ExternalLink from './ExternalLink';
import { renderZoneTicket } from './ZoneTicket';
import { getAlternativeFares } from '../util/fareUtils';
Expand Down
2 changes: 1 addition & 1 deletion app/component/TimeFrame.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from 'prop-types';
import React from 'react';
import moment from 'moment';
import moment from 'moment-timezone';

import { TIME_PATTERN, DATE_PATTERN } from '../util/timeUtils';

Expand Down
2 changes: 1 addition & 1 deletion app/component/Timetable.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PropTypes from 'prop-types';
import React from 'react';
import moment from 'moment';
import moment from 'moment-timezone';
import uniqBy from 'lodash/uniqBy';
import sortBy from 'lodash/sortBy';
import groupBy from 'lodash/groupBy';
Expand Down
2 changes: 1 addition & 1 deletion app/component/TransitLeg.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import cx from 'classnames';
import moment from 'moment';
import moment from 'moment-timezone';
import PropTypes from 'prop-types';
import React from 'react';
import { FormattedMessage, intlShape } from 'react-intl';
Expand Down
2 changes: 1 addition & 1 deletion app/component/WalkLeg.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import moment from 'moment';
import moment from 'moment-timezone';
import cx from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
Expand Down
2 changes: 1 addition & 1 deletion app/component/map/StopPageMap.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PropTypes from 'prop-types';
import React, { useEffect, useContext, useState } from 'react';
import { matchShape, routerShape } from 'found';
import moment from 'moment';
import moment from 'moment-timezone';
import { connectToStores } from 'fluxible-addons-react';
import distance from '@digitransit-search-util/digitransit-search-util-distance';
import { graphql, fetchQuery } from 'react-relay';
Expand Down
2 changes: 1 addition & 1 deletion app/component/map/StopsNearYouMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useState, useRef } from 'react';
import PropTypes from 'prop-types';
import { matchShape } from 'found';
import { graphql, fetchQuery } from 'react-relay';
import moment from 'moment';
import moment from 'moment-timezone';
import uniqBy from 'lodash/uniqBy';
import compact from 'lodash/compact';
import indexOf from 'lodash/indexOf';
Expand Down
2 changes: 1 addition & 1 deletion app/component/map/VehicleMarkerContainer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PropTypes from 'prop-types';
import React from 'react';
import connectToStores from 'fluxible-addons-react/connectToStores';
import moment from 'moment';
import moment from 'moment-timezone';
import { ExtendedRouteTypes } from '../../constants';
import VehicleIcon from '../VehicleIcon';
import IconMarker from './IconMarker';
Expand Down
2 changes: 1 addition & 1 deletion app/component/map/popups/OSMOpeningHours.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import SimpleOpeningHours from 'simple-opening-hours';
import React from 'react';
import PropTypes from 'prop-types';
import { FormattedMessage, intlShape } from 'react-intl';
import moment from 'moment';
import moment from 'moment-timezone';
import Icon from '../../Icon';

export default class OSMOpeningHours extends React.Component {
Expand Down
2 changes: 1 addition & 1 deletion app/component/map/route/TripMarkerPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createFragmentContainer, graphql } from 'react-relay';

import Link from 'found/Link';
import { FormattedMessage } from 'react-intl';
import moment from 'moment';
import moment from 'moment-timezone';
import { PREFIX_ROUTES, PREFIX_STOPS } from '../../../util/path';

import RouteHeader from '../../RouteHeader';
Expand Down
2 changes: 1 addition & 1 deletion app/component/map/sidebar/WeatherStationContent.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PropTypes from 'prop-types';
import React from 'react';
import { FormattedMessage, intlShape } from 'react-intl';
import moment from 'moment';
import moment from 'moment-timezone';
import { isNumber } from 'lodash';
import SidebarContainer from './SidebarContainer';

Expand Down
2 changes: 1 addition & 1 deletion app/store/OldSearchesStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import find from 'lodash/find';
import get from 'lodash/get';
import isEqual from 'lodash/isEqual';
import orderBy from 'lodash/orderBy';
import moment from 'moment';
import moment from 'moment-timezone';

import { getNameLabel } from '@digitransit-search-util/digitransit-search-util-uniq-by-label';
import { getOldSearchesStorage, setOldSearchesStorage } from './localStorage';
Expand Down
2 changes: 1 addition & 1 deletion app/store/TimeStore.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Store from 'fluxible/addons/BaseStore';
import moment from 'moment';
import moment from 'moment-timezone';

class TimeStore extends Store {
static storeName = 'TimeStore';
Expand Down
2 changes: 1 addition & 1 deletion app/util/apiUtils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import moment from 'moment';
import moment from 'moment-timezone';
import xmlParser from 'fast-xml-parser';
import isEmpty from 'lodash/isEmpty';
import { retryFetch } from './fetchUtils';
Expand Down
2 changes: 1 addition & 1 deletion app/util/dateParamUtils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import moment from 'moment';
import moment from 'moment-timezone';

import { DATE_FORMAT } from '../constants';

Expand Down
2 changes: 1 addition & 1 deletion app/util/mqttClient.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ceil from 'lodash/ceil';
import moment from 'moment';
import moment from 'moment-timezone';
import { parseFeedMQTT } from './gtfsRtParser';
import { convertTo24HourFormat } from './timeUtils';

Expand Down
2 changes: 1 addition & 1 deletion app/util/patternUtils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import moment from 'moment';
import moment from 'moment-timezone';
/**
Helper for determining is current date in active dates.
Return false if pattern doesn't have active dates information available
Expand Down
2 changes: 1 addition & 1 deletion app/util/planParamUtil.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import omitBy from 'lodash/omitBy';
import moment from 'moment';
import moment from 'moment-timezone';
import Cookies from 'universal-cookie';
import booleanPointInPolygon from '@turf/boolean-point-in-polygon';
import point from 'turf-point';
Expand Down
2 changes: 1 addition & 1 deletion app/util/routePatternSelectUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* eslint-disable prefer-destructuring */

import cloneDeep from 'lodash/cloneDeep';
import moment from 'moment';
import moment from 'moment-timezone';

export const DATE_FORMAT = 'YYYYMMDD';
export const DATE_FORMAT2 = 'D.M.';
Expand Down
2 changes: 1 addition & 1 deletion app/util/routeScheduleParamUtils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import moment from 'moment';
import moment from 'moment-timezone';
import { DATE_FORMAT } from '../constants';

const populateData = (params, match, noOfWeeks) => {
Expand Down
2 changes: 1 addition & 1 deletion app/util/timeUtils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import moment from 'moment';
import moment from 'moment-timezone';

export const TIME_PATTERN = 'HH:mm';
export const DATE_PATTERN = 'dd D.M.';
Expand Down
4 changes: 2 additions & 2 deletions config/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const globals = {
classnames: 'cx',
'prop-types': 'PropTypes',
i18next: 'i18next',
'moment-timezone': 'moment',
'moment-timezone': 'moment-timezone',
'react-autosuggest': 'Autosuggest',
'react-sortablejs': 'reactSortablejs',
'react-modal': 'ReactModal',
Expand Down Expand Up @@ -48,7 +48,7 @@ const globals = {
'lodash/get': 'get',
'lodash/uniq': 'uniq',
'lodash/compact': 'compact',
moment: 'moment',
moment: 'moment-timezone',
'react-relay': 'reactRelay',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import take from 'lodash/take';
import flatten from 'lodash/flatten';
import uniq from 'lodash/uniq';
import compact from 'lodash/compact';
import moment from 'moment';
import moment from 'moment-timezone';
import { fetchQuery, graphql } from 'react-relay';
import routeNameCompare from '@digitransit-search-util/digitransit-search-util-route-name-compare';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* eslint-disable prefer-destructuring */
import dayRangeAllowedDiff from '@digitransit-util/digitransit-util-day-range-allowed-diff';
import cloneDeep from 'lodash/cloneDeep';
import moment from 'moment';
import moment from 'moment-timezone';

const DATE_FORMAT = 'YYYYMMDD';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-extraneous-dependencies */
import { expect } from 'chai';
import { describe, it } from 'mocha';
import moment from 'moment';
import moment from 'moment-timezone';
import enrichPatterns from '.';

describe('Testing @digitransit-util/digitransit-util-enrich-patterns module', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable no-nested-ternary */
/* eslint no-bitwise: ["error", { "allow": [">>"] }] */

import moment from 'moment';
import moment from 'moment-timezone';
import i18next from 'i18next';
import translations from './helpers/translations';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable func-names */
import { expect } from 'chai';
import { describe, it } from 'mocha';
import moment from 'moment';
import moment from 'moment-timezone';
import cloneDeep from 'lodash/cloneDeep';
import routePatternOptionText from '.';

Expand Down
2 changes: 1 addition & 1 deletion server/passport-openid-connect/Strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'use strict';

const { Issuer, Strategy, custom } = require('openid-client');
const moment = require('moment');
const moment = require('moment-timezone');
const util = require('util');
const process = require('process');
const User = require('./User').User;
Expand Down
2 changes: 1 addition & 1 deletion server/passport-openid-connect/openidConnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const passport = require('passport');
const session = require('express-session');
const redis = require('redis');
const axios = require('axios');
const moment = require('moment');
const moment = require('moment-timezone');
const RedisStore = require('connect-redis')(session);
const LoginStrategy = require('./Strategy').Strategy;

Expand Down
2 changes: 1 addition & 1 deletion test/unit/OldSearchesStore.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { expect } from 'chai';
import { afterEach, describe, it } from 'mocha';
import MockDate from 'mockdate';
import moment from 'moment';
import moment from 'moment-timezone';

import OldSearchesStore, {
STORE_VERSION,
Expand Down
2 changes: 1 addition & 1 deletion test/unit/component/LangSelect.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from 'chai';
import { describe, it } from 'mocha';
import React from 'react';
import moment from 'moment';
import moment from 'moment-timezone';

import { mockContext } from '../helpers/mock-context';
import { shallowWithIntl } from '../helpers/mock-intl-enzyme';
Expand Down
2 changes: 1 addition & 1 deletion test/unit/component/RoutePageControlPanel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { describe, it } from 'mocha';
import React from 'react';
import sinon from 'sinon';

import moment from 'moment';
import moment from 'moment-timezone';
import { mockContext } from '../helpers/mock-context';
import { mockMatch, mockRouter } from '../helpers/mock-router';
import { shallowWithIntl } from '../helpers/mock-intl-enzyme';
Expand Down
2 changes: 1 addition & 1 deletion test/unit/component/RoutePatternSelect.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { describe, it } from 'mocha';
import React from 'react';
import sinon from 'sinon';
import moment from 'moment'; // DT-3182
import moment from 'moment-timezone'; // DT-3182
import { shallowWithIntl } from '../helpers/mock-intl-enzyme';
import { mockContext } from '../helpers/mock-context';
import { Component as RoutePatternSelect } from '../../../app/component/RoutePatternSelect';
Expand Down
Loading

0 comments on commit c4e9c35

Please sign in to comment.