use moment to detect timezones

This commit is contained in:
Andris Reinman 2016-04-29 19:13:51 +03:00
parent ae8a79ea07
commit 6e514e1ccc
11 changed files with 74 additions and 142 deletions

View file

@ -234,6 +234,9 @@ module.exports.insert = (listId, meta, subscription, callback) => {
Object.keys(subscription).forEach(key => {
let value = subscription[key];
key = tools.toDbKey(key);
if (key === 'tz') {
value = (value || '').toString().toLowerCase().trim();
}
if (allowedKeys.indexOf(key) >= 0) {
keys.push(key);
values.push(value);
@ -443,6 +446,9 @@ module.exports.update = (listId, cid, updates, allowEmail, callback) => {
Object.keys(updates).forEach(key => {
let value = updates[key];
key = tools.toDbKey(key);
if (key === 'tz') {
value = (value || '').toString().toLowerCase().trim();
}
if (allowedKeys.indexOf(key) >= 0) {
keys.push(key);
values.push(value);