-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ADD custom footer block with build time
- Loading branch information
Jaume Florez
committed
May 23, 2018
1 parent
42a000b
commit 785f0f0
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{% extends "base.html" %} | ||
{% block footer %} | ||
{% include "partials/footer.html" %} | ||
<script> | ||
// Get all afected elements (copyright) | ||
var elements = document.getElementsByClassName("md-footer-copyright") | ||
var locale = navigator.language || navigator.languages[0] || "en" | ||
for(footer_idx=0; footer_idx< elements.length; footer_idx++){ | ||
var footer = elements[footer_idx] | ||
footer_date=document.createElement("div") | ||
// <OFFSET>minutes * 60 seconds * 1000 miliseconds * -1 local time | ||
offset=new Date().getTimezoneOffset()*60*1000*-1 | ||
build_date=new Date("{{ build_date_utc }}").getTime() | ||
build_date=new Date(build_date+offset) | ||
if (locale == 'es' || locale == 'es_ES'){ | ||
build_text = 'Fecha última modificación: ' | ||
} else if (locale == 'ca' || locale == 'ca_ES') { | ||
build_text = "Data d'última modificació: " | ||
} else { | ||
build_text = "Last build on: " | ||
} | ||
footer_date.innerHTML=build_text + build_date.getFullYear() + "-" + (build_date.getMonth()+1) + "-" + build_date.getDate() + " " + build_date.toLocaleTimeString(locale, {hourCycle:"h24", hour: "2-digit", minute: "2-digit",second: "2-digit"}) | ||
footer.appendChild(footer_date) | ||
} | ||
</script> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ theme: | |
feature: | ||
tabs: true | ||
language: 'ca' | ||
custom_dir: custom | ||
|
||
markdown_extensions: | ||
- admonition | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ theme: | |
feature: | ||
tabs: true | ||
language: 'es' | ||
custom_dir: custom | ||
|
||
markdown_extensions: | ||
- admonition | ||
|