DEV: Update JS class sorting to match new lint rule

This commit is contained in:
David Taylor
2022-08-14 12:07:44 +01:00
parent b362e614e4
commit 6cac35ca29
8 changed files with 99 additions and 99 deletions

View File

@ -14,6 +14,19 @@ import { getProperties } from "@ember/object";
duration between two dates, eg for duration: "1.weeks", "2.months"...
*/
export default class DateWithZoneHelper {
static fromDatetime(datetime, timezone, localTimezone) {
return new DateWithZoneHelper({
year: datetime.year(),
month: datetime.month(),
day: datetime.date(),
hour: datetime.hour(),
minute: datetime.minute(),
second: datetime.second(),
timezone,
localTimezone,
});
}
constructor(params = {}) {
this.timezone = params.timezone || "UTC";
this.localTimezone = params.localTimezone || moment.tz.guess();
@ -77,19 +90,6 @@ export default class DateWithZoneHelper {
return this.datetime.tz(this.localTimezone).toISOString(true);
}
static fromDatetime(datetime, timezone, localTimezone) {
return new DateWithZoneHelper({
year: datetime.year(),
month: datetime.month(),
day: datetime.date(),
hour: datetime.hour(),
minute: datetime.minute(),
second: datetime.second(),
timezone,
localTimezone,
});
}
_fromDatetime(datetime, timezone, localTimezone) {
return DateWithZoneHelper.fromDatetime(datetime, timezone, localTimezone);
}