Fix timezone problem
This commit is contained in:
parent
16af27106f
commit
a7a9bfb094
@ -91,9 +91,9 @@ async function fetchFeed(feedURL, n, nick) {
|
|||||||
var body = striptags(body);
|
var body = striptags(body);
|
||||||
if (data.isoDate !== undefined) {
|
if (data.isoDate !== undefined) {
|
||||||
var date = moment(data.isoDate)
|
var date = moment(data.isoDate)
|
||||||
if (uconfig[nick].timezone != undefined) {
|
try {
|
||||||
var syncDate = date.tz(uconfig[nick].timezone)
|
var syncDate = date.tz(uconfig[nick].timezone)
|
||||||
} else {
|
} catch(e) {
|
||||||
var syncDate = date.tz(config.feed.timezone)
|
var syncDate = date.tz(config.feed.timezone)
|
||||||
}
|
}
|
||||||
var date = syncDate.format(config.feed.time_format)
|
var date = syncDate.format(config.feed.time_format)
|
||||||
|
@ -162,12 +162,11 @@ async function github(user, repo, type, n, nick) {
|
|||||||
|
|
||||||
if (data.isoDate !== undefined) {
|
if (data.isoDate !== undefined) {
|
||||||
var date = moment(data.isoDate)
|
var date = moment(data.isoDate)
|
||||||
if (uconfig[nick].timezone != undefined) {
|
try {
|
||||||
var syncDate = date.tz(uconfig[nick].timezone)
|
var syncDate = date.tz(uconfig[nick].timezone)
|
||||||
} else {
|
} catch(e) {
|
||||||
var syncDate = date.tz(config.feed.timezone)
|
var syncDate = date.tz(config.feed.timezone)
|
||||||
}
|
}
|
||||||
//console.log(syncDate.format())
|
|
||||||
var date = syncDate.format(config.feed.time_format)
|
var date = syncDate.format(config.feed.time_format)
|
||||||
} else {
|
} else {
|
||||||
var date = data.pubDate
|
var date = data.pubDate
|
||||||
|
@ -77,9 +77,9 @@ async function fetchFeed(feedURL, n) {
|
|||||||
var body = striptags(body);
|
var body = striptags(body);
|
||||||
if (data.isoDate !== undefined) {
|
if (data.isoDate !== undefined) {
|
||||||
var date = moment(data.isoDate)
|
var date = moment(data.isoDate)
|
||||||
if (uconfig[nick].timezone != undefined) {
|
try {
|
||||||
var syncDate = date.tz(uconfig[nick].timezone)
|
var syncDate = date.tz(uconfig[nick].timezone)
|
||||||
} else {
|
} catch(e) {
|
||||||
var syncDate = date.tz(config.feed.timezone)
|
var syncDate = date.tz(config.feed.timezone)
|
||||||
}
|
}
|
||||||
var date = syncDate.format(config.feed.time_format)
|
var date = syncDate.format(config.feed.time_format)
|
||||||
|
@ -203,7 +203,12 @@ async function set(setting, value, value2, nick) {
|
|||||||
sendUpstream(errorMsg+' Invalid timezone entered, not changing')
|
sendUpstream(errorMsg+' Invalid timezone entered, not changing')
|
||||||
}
|
}
|
||||||
var file = editJsonFile('/home/node/app/config/usersettings.json');
|
var file = editJsonFile('/home/node/app/config/usersettings.json');
|
||||||
if (uconfig[nick].timezone == undefined || uconfig[nick].timezone == "" ) {
|
//try {
|
||||||
|
// var oldvalue = file.get(nick+".timezone")
|
||||||
|
//} catch(e) {
|
||||||
|
// var oldvalue = "Unset"
|
||||||
|
//}
|
||||||
|
if (file.get(nick+".timezone") == undefined || file.get(nick+".timezone") == "" ) {
|
||||||
var oldvalue = "Unset"
|
var oldvalue = "Unset"
|
||||||
} else {
|
} else {
|
||||||
var oldvalue = file.get(nick+".timezone")
|
var oldvalue = file.get(nick+".timezone")
|
||||||
|
Loading…
Reference in New Issue
Block a user