From 10a479ecd22624a9a19350d217d6766dff2c4c2e Mon Sep 17 00:00:00 2001 From: Matt Loar Date: Tue, 3 Sep 2019 17:54:43 -0500 Subject: [PATCH] Fix broken tests --- app/components/mdl-datefield.js | 38 --------------------------------- app/routes/work/sources.js | 1 - 2 files changed, 39 deletions(-) delete mode 100644 app/components/mdl-datefield.js diff --git a/app/components/mdl-datefield.js b/app/components/mdl-datefield.js deleted file mode 100644 index 5d63d50..0000000 --- a/app/components/mdl-datefield.js +++ /dev/null @@ -1,38 +0,0 @@ -import { scheduleOnce } from '@ember/runloop'; -import { computed } from '@ember/object'; -import MdlTextfield from 'ember-material-lite/components/mdl-textfield'; - -export default MdlTextfield.extend({ - // Needed until https://github.com/mike-north/ember-material-lite/pull/94 - // is merged - didUpdate() { - scheduleOnce('afterRender', this, () => { - this.get('_mdlComponent').updateClasses_(); - }); - return this._super(...arguments); - }, - type: 'date', - date: computed('value', { - get() { - try { - // Create Date at midnight local time - var struct = /^(\d{4})-(\d{2})-(\d{2})$/.exec(this.get('value')); - return new Date(struct[1], struct[2] - 1, struct[3]); - } - // eslint-disable-next-line no-empty - catch (RangeError) { - } - - return null; - }, - set(key, date) { - if (date) { - // This is a bit of hack - we need the YYYY-mm-dd format in local time. So we remove the offset and - // then call toISOString, which is in UTC. - this.set('value', - new Date(date.valueOf() - date.getTimezoneOffset() * 60000).toISOString().substring(0, 10)); - } - return date; - } - }) -}); diff --git a/app/routes/work/sources.js b/app/routes/work/sources.js index 45794ba..aa2f00e 100644 --- a/app/routes/work/sources.js +++ b/app/routes/work/sources.js @@ -1,5 +1,4 @@ import EmberRoute from '@ember/routing/route'; -import moment from 'moment'; export default EmberRoute.extend({ model() {