Relative local time
This commit is contained in:
@@ -669,7 +669,7 @@ function addSpotMessages(aoMessages) {
|
||||
if(oMsg.formatted_time_local != oMsg.formatted_time) {
|
||||
$Tooltip.append($('<p>', {'class':'timezone'})
|
||||
.addIcon('fa-timezone fa-fw fa-lg', true)
|
||||
.append(oSpot.lang('local_time', oMsg.formatted_time_local)));
|
||||
.append(oSpot.lang('local_time', getRelativeTime(oMsg.formatted_time_local, oMsg.day_offset))));
|
||||
}
|
||||
|
||||
//Weather
|
||||
@@ -853,6 +853,12 @@ function focusOnPost(oFocusPost) {
|
||||
}
|
||||
}
|
||||
|
||||
function getRelativeTime(sLocalTime, iOffset) {
|
||||
let $Time = $('<span>').text(sLocalTime.substr(-5));
|
||||
if(iOffset != '0') $Time.append($('<sup>', {'title': iOffset+' '+oSpot.lang('unit_day')+' ('+sLocalTime.substr(0, 5)+')'}).text(' '+iOffset));
|
||||
return $Time.html();
|
||||
}
|
||||
|
||||
function getPost(asPost) {
|
||||
asPost.headerless = asPost.headerless || false;
|
||||
var bLink = false;
|
||||
@@ -877,7 +883,7 @@ function getPost(asPost) {
|
||||
.data('clicked', false)
|
||||
.append($('<p>').addIcon('fa-coords', true).append(getGoogleMapsLink(asPost)))
|
||||
.append($('<p>').addIcon('fa-time', true).append(sAbsTime))
|
||||
.append(bTimeDiff?$('<p>').addIcon('fa-timezone', true).append(oSpot.lang('local_time', sAbsTimeLocal)):'')
|
||||
.append(bTimeDiff?$('<p>').addIcon('fa-timezone', true).append(oSpot.lang('local_time', getRelativeTime(sAbsTimeLocal, asPost.day_offset))):'')
|
||||
.append($('<a>', {'class':'drill'})
|
||||
.append((!asPost.weather_icon || asPost.weather_icon=='unknown')?'':$('<span>', {'class':'weather', 'title':oSpot.lang(asPost.weather_cond)}).addIcon('fa-'+asPost.weather_icon).append($('<span>').text(asPost.weather_temp+'°C')))
|
||||
.append($('<img>', {'class':'staticmap', title: oSpot.lang('click_zoom'), src: asPost.static_img_url}))
|
||||
|
||||
Reference in New Issue
Block a user