Use UTC for event button

This commit is contained in:
Brandon Keepers
2018-07-10 09:46:20 -05:00
parent bde01dcb31
commit 1236236066
2 changed files with 11 additions and 5 deletions

View File

@@ -25,10 +25,16 @@ function displayTime(elements, time) {
var format = el.dataset.format
var value;
if(format == 'fromNow') {
value = time.local().fromNow();
if(el.dataset.hasOwnProperty('utc')) {
time = time.utc()
} else {
value = time.local().format(format);
time = time.local()
}
if(format == 'fromNow') {
value = time.fromNow();
} else {
value = time.format(format);
}
el.innerHTML = value;

View File

@@ -47,8 +47,8 @@ redirect_from:
{% octicon calendar class:"mr-2" %} Add to Calendar
</a>
<span class="start js-office-hours-start-time" data-format="YYYY-MM-DD HH:mm"></span>
<span class="end js-office-hours-end-time" data-format="YYYY-MM-DD HH:mm"></span>
<span class="start js-office-hours-start-time" data-format="YYYY-MM-DD HH:mm" data-utc></span>
<span class="end js-office-hours-end-time" data-format="YYYY-MM-DD HH:mm" data-utc></span>
<span class="timezone">UTC</span>
<span class="title">Probot Office Hours</span>
<span class="description">Join us every week to give feedback, ask questions, get help, or just chat about ideas.</span>