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:
Joffrey JAFFEUX
2018-09-12 15:54:36 +02:00
committed by Guo Xiang Tan
parent 33541c4096
commit 4b3c2490c3
4 changed files with 57 additions and 30 deletions

View File

@ -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",