mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: ensures seconds are displayed when used with dates (#10170)
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import I18n from "I18n";
|
||||
import LocalDateBuilder from "./local-date-builder";
|
||||
|
||||
const UTC = "Etc/UTC";
|
||||
@ -68,15 +69,23 @@ QUnit.test("date", assert => {
|
||||
{ formated: "March 22, 2020" },
|
||||
"it displays the date without time"
|
||||
);
|
||||
|
||||
assert.buildsCorrectDate(
|
||||
{ date: "2020-04-11", time: "11:00" },
|
||||
{ formated: "April 11, 2020 1:00 PM" },
|
||||
"it displays the date with time"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
QUnit.test("date and time", assert => {
|
||||
assert.buildsCorrectDate(
|
||||
{ date: "2020-04-11", time: "11:00" },
|
||||
{ formated: "April 11, 2020 1:00 PM" },
|
||||
"it displays the date with time"
|
||||
);
|
||||
|
||||
assert.buildsCorrectDate(
|
||||
{ date: "2020-04-11", time: "11:05:12", format: "LTS" },
|
||||
{ formated: "1:05:12 PM" },
|
||||
"it displays full time (hours, minutes, seconds)"
|
||||
);
|
||||
});
|
||||
|
||||
QUnit.test("option[format]", assert => {
|
||||
freezeTime({ date: "2020-03-11" }, () => {
|
||||
assert.buildsCorrectDate(
|
||||
|
Reference in New Issue
Block a user