FIX: Make time attribute as optional for local-dates bbcode

This commit is contained in:
Vinoth Kannan 2018-10-12 05:44:00 +05:30
parent a1c912b630
commit f07bece17f
2 changed files with 12 additions and 2 deletions

View File

@ -101,7 +101,7 @@
var options = {};
options.format = $this.attr("data-format");
options.date = $this.attr("data-date");
options.time = $this.attr("data-time");
options.time = $this.attr("data-time") || "00:00:00";
options.recurring = $this.attr("data-recurring");
options.timezones = $this.attr("data-timezones");
options.forceTimezone = $this.attr("data-force-timezone");

View File

@ -20,6 +20,16 @@ test("local dates bbcode", async assert => {
assert.ok(
exists(".d-editor-preview .discourse-local-date.past.cooked-date"),
"it should contain the cooked date output"
"it should contain the cooked output for date & time inputs"
);
await fillIn(
".d-editor-input",
'[date=2017-10-23 format="LL" timezone="Asia/Calcutta" timezones="Europe/Paris|America/Los_Angeles"]'
);
assert.ok(
exists(".d-editor-preview .discourse-local-date.past.cooked-date"),
"it should contain the cooked output for date only input"
);
});