Просмотр исходного кода

added variables for hours, minutes, seconds

Gildas 7 лет назад
Родитель
Сommit
438a78c76e
2 измененных файлов с 12 добавлено и 0 удалено
  1. 6 0
      extension/ui/pages/help.html
  2. 6 0
      lib/single-file/single-file-core.js

+ 6 - 0
extension/ui/pages/help.html

@@ -145,6 +145,12 @@
 							<li><code>{month-locale}</code>: the localized value of the month (e.g. "9")</li>
 							<li><code>{year-utc}</code>: the year of the save date in UTC format (e.g. "2018")</li>
 							<li><code>{year-locale}</code>: the localized value of the year (e.g. "2018")</li>
+							<li><code>{hours-utc}</code>: the hour of the save date in UTC format (e.g. "20")</li>
+							<li><code>{hours-locale}</code>: the localized value of the hour (e.g. "22")</li>
+							<li><code>{minutes-utc}</code>: the minutes of the save date in UTC format (e.g. "38")</li>
+							<li><code>{minutes-locale}</code>: the localized value of the minutes (e.g. "38")</li>
+							<li><code>{seconds-utc}</code>: the seconds of the save date in UTC format (e.g. "31")</li>
+							<li><code>{seconds-locale}</code>: the localized value of the seconds (e.g. "31")</li>
 							<li><code>{url-href}</code>: the URL of the page (e.g. "http_example.com")</li>
 							<li><code>{url-pathname}</code>: the path name of the URL (e.g. "category_index.html")</li>
 							<li><code>{url-last-segment}</code>: the last part of the pathname (without the extension) or the host if not

+ 6 - 0
lib/single-file/single-file-core.js

@@ -866,6 +866,12 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 			filename = await DomUtil.evalTemplateVariable(filename, "day-utc", () => String(date.getUTCDate()));
 			filename = await DomUtil.evalTemplateVariable(filename, "month-utc", () => String(date.getUTCMonth()));
 			filename = await DomUtil.evalTemplateVariable(filename, "year-utc", () => String(date.getUTCFullYear()));
+			filename = await DomUtil.evalTemplateVariable(filename, "hours-locale", () => String(date.getHours()));
+			filename = await DomUtil.evalTemplateVariable(filename, "minutes-locale", () => String(date.getMinutes()));
+			filename = await DomUtil.evalTemplateVariable(filename, "seconds-locale", () => String(date.getSeconds()));
+			filename = await DomUtil.evalTemplateVariable(filename, "hours-utc", () => String(date.getUTCHours()));
+			filename = await DomUtil.evalTemplateVariable(filename, "minutes-utc", () => String(date.getUTCMinutes()));
+			filename = await DomUtil.evalTemplateVariable(filename, "seconds-utc", () => String(date.getUTCSeconds()));
 			filename = await DomUtil.evalTemplateVariable(filename, "url-hash", () => url.hash.substring(1));
 			filename = await DomUtil.evalTemplateVariable(filename, "url-host", () => url.host.replace(/\/$/, ""));
 			filename = await DomUtil.evalTemplateVariable(filename, "url-hostname", () => url.hostname.replace(/\/$/, ""));