mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
FIX: allowes forcing timezone displayed in local-dates
Use case being you might want to always display a specific timezone, but still have the possibility to show the tooltip with various timezones.
This commit is contained in:

committed by
Guo Xiang Tan

parent
33541c4096
commit
4b3c2490c3
@ -18,6 +18,7 @@ function addLocalDate(buffer, matches, state) {
|
||||
|
||||
config.date = parsed.attrs.date;
|
||||
config.time = parsed.attrs.time;
|
||||
config.forceTimezone = parsed.attrs.forceTimezone;
|
||||
config.recurring = parsed.attrs.recurring;
|
||||
config.format = parsed.attrs.format || config.format;
|
||||
config.timezones = parsed.attrs.timezones || config.timezones;
|
||||
@ -28,9 +29,15 @@ function addLocalDate(buffer, matches, state) {
|
||||
["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)]
|
||||
["data-timezones", state.md.utils.escapeHtml(config.timezones)],
|
||||
];
|
||||
|
||||
if (config.forceTimezone) {
|
||||
token.attrs.push(
|
||||
["data-force-timezone", state.md.utils.escapeHtml(config.forceTimezone)]
|
||||
);
|
||||
}
|
||||
|
||||
if (config.recurring) {
|
||||
token.attrs.push([
|
||||
"data-recurring",
|
||||
|
Reference in New Issue
Block a user