FIX: displays poll's close date in local time (#9656)
This commit is contained in:
parent
7acb25db12
commit
029d091ea8
|
@ -745,7 +745,7 @@ createWidget("discourse-poll-buttons", {
|
|||
}
|
||||
|
||||
if (poll.get("close")) {
|
||||
const closeDate = moment.utc(poll.get("close"));
|
||||
const closeDate = moment(poll.get("close"));
|
||||
if (closeDate.isValid()) {
|
||||
const title = closeDate.format("LLL");
|
||||
let label;
|
||||
|
@ -754,7 +754,7 @@ createWidget("discourse-poll-buttons", {
|
|||
const age = relativeAge(closeDate.toDate(), { addAgo: true });
|
||||
label = I18n.t("poll.automatic_close.age", { age });
|
||||
} else {
|
||||
const timeLeft = moment().to(closeDate.local(), true);
|
||||
const timeLeft = moment().to(closeDate, true);
|
||||
label = I18n.t("poll.automatic_close.closes_in", { timeLeft });
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue