Skip to content

Commit

Permalink
Update usages of moment to import as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
Tonkpils committed Sep 24, 2023
1 parent 0534e76 commit 2e5db9a
Show file tree
Hide file tree
Showing 31 changed files with 35 additions and 3 deletions.
3 changes: 2 additions & 1 deletion frontend/app/components/add-reminder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Ember from 'ember';
import { translationMacro as t } from "ember-i18n";
import moment from 'moment-timezone';

const {
get,
Expand Down Expand Up @@ -28,7 +29,7 @@ export default Component.extend({
title: null,

timezones: computed(function() {
let originNames = typeof moment !== 'undefined' && moment.tz && moment.tz.names();
let originNames = moment.tz.names();

if(originNames) {
return originNames.map((timezone) => {
Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/birth-date.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Component from '@ember/component';
import { get, computed } from '@ember/object';
import moment from 'moment';

export default Component.extend({
classNames: ['birthDate'],
Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/chart-navigation.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Ember from 'ember';
import moment from 'moment';

const {
$,
Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/chart-patterns.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Ember from 'ember';
import CheckinByDate from 'flaredown/mixins/checkin-by-date';
import DatesRetriever from 'flaredown/mixins/chart/dates-retriever';
import DS from 'ember-data';
import moment from 'moment';

const {
get,
Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/chart/g-flat.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Ember from 'ember';
import moment from 'moment';
import Graphable from 'flaredown/components/chart/graphable';

const {
Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/chart/g-hbi.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Ember from 'ember';
import moment from 'moment';
import Colorable from 'flaredown/mixins/colorable';
import Graphable from 'flaredown/components/chart/graphable';

Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/chart/g-timeline.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Ember from 'ember';
import moment from 'moment';

export default Ember.Component.extend( {
tagName: 'g',
Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/chart/g-trackable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Ember from 'ember';
import moment from 'moment';
import Graphable from 'flaredown/components/chart/graphable';

const {
Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/chart/g-weather.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Ember from 'ember';
import moment from 'moment';
import Colorable from 'flaredown/mixins/colorable';
import Graphable from 'flaredown/components/chart/graphable';

Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/checkin/days-nav.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Ember from 'ember';
import moment from 'moment';
import CheckinByDate from 'flaredown/mixins/checkin-by-date';

const {
Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/checkin/trackables-step.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Ember from 'ember';
import DS from 'ember-data';
import moment from 'moment';
import TrackablesFromType from 'flaredown/mixins/trackables-from-type';

const {
Expand Down
4 changes: 4 additions & 0 deletions frontend/app/components/health-chart.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import Ember from 'ember';
import Moment from 'moment';
import { extendMoment } from 'moment-range';
import Resizable from './chart/resizable';
import FieldsByUnits from 'flaredown/mixins/fields-by-units';
import DatesRetriever from 'flaredown/mixins/chart/dates-retriever';

const moment = extendMoment(Moment);

const {
get,
set,
Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/journal-entry.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Ember from 'ember';
import moment from 'moment';

const {
get,
Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/journal-list.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Ember from 'ember';
import moment from 'moment';

const {
get,
Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/onboarding/completed-step.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Ember from 'ember';
import CheckinByDate from 'flaredown/mixins/checkin-by-date';
import moment from 'moment';

export default Ember.Component.extend(CheckinByDate, {

Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/pattern/chart-group.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Ember from 'ember';
import moment from 'moment';

/* global d3 */

Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/pattern/chart-hover.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Ember from 'ember';
import moment from 'moment';

/* global d3 */

Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/pattern/chart-item.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Ember from 'ember';
import moment from 'moment';

/* global d3 */

Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/pattern/index-step.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Ember from 'ember';
import DS from 'ember-data';
import moment from 'moment';

const {
get,
Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/pattern/svg-initial.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Ember from 'ember';
import DatesRetriever from 'flaredown/mixins/chart/dates-retriever';
import moment from 'moment';

const {
get,
Expand Down
1 change: 1 addition & 0 deletions frontend/app/components/signup-form.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Ember from 'ember';
import moment from 'moment';

const {
get,
Expand Down
3 changes: 2 additions & 1 deletion frontend/app/helpers/checkToday.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { helper } from "@ember/component/helper";
import { helper } from '@ember/component/helper';
import moment from 'moment';

export function checkToday(params) {
let [date, displayText] = params;
Expand Down
1 change: 0 additions & 1 deletion frontend/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<script src="{{rootURL}}assets/drag-drop-polyfill/release/drag-drop-polyfill.js"></script>
<script src="{{rootURL}}assets/vendor.js"></script>

<script src="{{rootURL}}assets/moment-timezone/builds/moment-timezone-with-data.js"></script>
<script src="{{rootURL}}assets/flaredown.js"></script>

{{content-for "body-footer"}}
Expand Down
1 change: 1 addition & 0 deletions frontend/app/mixins/chart/chart-data-retrieve.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Ember from 'ember';
import moment from 'moment';

const {
get,
Expand Down
1 change: 1 addition & 0 deletions frontend/app/mixins/chart/dates-retriever.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Ember from 'ember';
import moment from 'moment';

const {
get,
Expand Down
1 change: 1 addition & 0 deletions frontend/app/mixins/checkin-by-date.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Ember from 'ember';
import moment from 'moment';

/*
Assumes the following exist:
Expand Down
1 change: 1 addition & 0 deletions frontend/app/models/checkin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import DS from 'ember-data';
import Ember from 'ember';
import moment from 'moment';

const {
attr,
Expand Down
1 change: 1 addition & 0 deletions frontend/app/routes/checkin/date.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Ember from 'ember';
import AuthenticatedRouteMixin from 'flaredown/mixins/authenticated-route-mixin';
import CheckinByDate from 'flaredown/mixins/checkin-by-date';
import moment from 'moment';

const {
set,
Expand Down
1 change: 1 addition & 0 deletions frontend/app/routes/checkin/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Ember from 'ember';
import AuthenticatedRouteMixin from 'flaredown/mixins/authenticated-route-mixin';
import CheckinByDate from 'flaredown/mixins/checkin-by-date';
import moment from 'moment';

const {
get,
Expand Down
1 change: 1 addition & 0 deletions frontend/app/routes/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Ember from 'ember';
import AuthenticatedRouteMixin from 'flaredown/mixins/authenticated-route-mixin';
import CheckinByDate from 'flaredown/mixins/checkin-by-date';
import moment from 'moment';

const {
get,
Expand Down
1 change: 1 addition & 0 deletions frontend/app/transforms/birthdate.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import DS from 'ember-data';
import Ember from 'ember';
import moment from 'moment';

const { get } = Ember;

Expand Down

0 comments on commit 2e5db9a

Please sign in to comment.