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);
|
||||
if (data.isoDate !== undefined) {
|
||||
var date = moment(data.isoDate)
|
||||
if (uconfig[nick].timezone != undefined) {
|
||||
try {
|
||||
var syncDate = date.tz(uconfig[nick].timezone)
|
||||
} else {
|
||||
} catch(e) {
|
||||
var syncDate = date.tz(config.feed.timezone)
|
||||
}
|
||||
var date = syncDate.format(config.feed.time_format)
|
||||
|
@ -162,12 +162,11 @@ async function github(user, repo, type, n, nick) {
|
||||
|
||||
if (data.isoDate !== undefined) {
|
||||
var date = moment(data.isoDate)
|
||||
if (uconfig[nick].timezone != undefined) {
|
||||
try {
|
||||
var syncDate = date.tz(uconfig[nick].timezone)
|
||||
} else {
|
||||
} catch(e) {
|
||||
var syncDate = date.tz(config.feed.timezone)
|
||||
}
|
||||
//console.log(syncDate.format())
|
||||
var date = syncDate.format(config.feed.time_format)
|
||||
} else {
|
||||
var date = data.pubDate
|
||||
|
@ -77,9 +77,9 @@ async function fetchFeed(feedURL, n) {
|
||||
var body = striptags(body);
|
||||
if (data.isoDate !== undefined) {
|
||||
var date = moment(data.isoDate)
|
||||
if (uconfig[nick].timezone != undefined) {
|
||||
try {
|
||||
var syncDate = date.tz(uconfig[nick].timezone)
|
||||
} else {
|
||||
} catch(e) {
|
||||
var syncDate = date.tz(config.feed.timezone)
|
||||
}
|
||||
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')
|
||||
}
|
||||
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"
|
||||
} else {
|
||||
var oldvalue = file.get(nick+".timezone")
|
||||
|
Loading…
Reference in New Issue
Block a user