FIX: some options on the topic timer modal weren't timezone aware (#15749)

These options weren't timezone aware:
- Two Weeks
- Six Months
This commit is contained in:
Andrei Prigorshnev 2022-02-01 13:55:26 +01:00 committed by GitHub
parent cd2e7d5436
commit 810391f474
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,19 +82,20 @@ export default Component.extend({
@discourseComputed()
customTimeShortcutOptions() {
const timezone = this.currentUser.resolvedTimezone(this.currentUser);
return [
{
icon: "far-clock",
id: "two_weeks",
label: "time_shortcut.two_weeks",
time: startOfDay(now().add(2, "weeks").day(MOMENT_MONDAY)),
time: startOfDay(now(timezone).add(2, "weeks").day(MOMENT_MONDAY)),
timeFormatKey: "dates.long_no_year",
},
{
icon: "far-calendar-plus",
id: "six_months",
label: "time_shortcut.six_months",
time: startOfDay(now().add(6, "months").startOf("month")),
time: startOfDay(now(timezone).add(6, "months").startOf("month")),
timeFormatKey: "dates.long_no_year",
},
];