Skip to content

Commit

Permalink
Convert date.js to a native class
Browse files Browse the repository at this point in the history
Updating this to Octane idioms allows us to remove one more bit of
Ember Classic code in the ecosystem!
  • Loading branch information
chriskrycho authored Apr 20, 2021
1 parent cead476 commit 897fbd0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions addon/services/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ import Service from '@ember/service';
* which allows you to override dates with static values without having to
* modify the native Date object.
*/
export default Service.extend({
export default class DateService extends Service {
now() {
return Date.now();
},
}

UTC(...args) {
return new Date(Date.UTC(...args));
},
}

parse(dateString) {
return Date.parse(dateString);
},
});
}
}

0 comments on commit 897fbd0

Please sign in to comment.