UX: Make time attribute optional and set default timezones
This commit is contained in:
parent
13b3cead06
commit
ee9d4f5516
|
@ -103,7 +103,7 @@
|
|||
options.date = $this.attr("data-date");
|
||||
options.time = $this.attr("data-time");
|
||||
options.recurring = $this.attr("data-recurring");
|
||||
options.timezones = $this.attr("data-timezones") || "Etc/UTC";
|
||||
options.timezones = $this.attr("data-timezones");
|
||||
options.forceTimezone = $this.attr("data-force-timezone");
|
||||
|
||||
processElement($this, options);
|
||||
|
|
|
@ -8,7 +8,7 @@ function addLocalDate(buffer, matches, state) {
|
|||
time: null,
|
||||
forceTimezone: null,
|
||||
format: "YYYY-MM-DD HH:mm:ss",
|
||||
timezones: ""
|
||||
timezones: "Etc/UTC"
|
||||
};
|
||||
|
||||
let parsed = parseBBCodeTag(
|
||||
|
@ -28,11 +28,17 @@ function addLocalDate(buffer, matches, state) {
|
|||
token.attrs = [
|
||||
["class", "discourse-local-date"],
|
||||
["data-date", state.md.utils.escapeHtml(config.date)],
|
||||
["data-time", state.md.utils.escapeHtml(config.time)],
|
||||
["data-format", state.md.utils.escapeHtml(config.format)],
|
||||
["data-timezones", state.md.utils.escapeHtml(config.timezones)]
|
||||
];
|
||||
|
||||
if (config.time) {
|
||||
token.attrs.push([
|
||||
"data-time",
|
||||
state.md.utils.escapeHtml(config.time)
|
||||
]);
|
||||
}
|
||||
|
||||
let dateTime;
|
||||
if (config.forceTimezone) {
|
||||
token.attrs.push([
|
||||
|
|
Loading…
Reference in New Issue