Commit 5624a137f19bc508201cff6468ac5b3fffef93cf
Use timezone from moment instead of (your timezone)
Peter Squicciarini committed on 6/12/2018, 6:25:01 PMParent: acdcd1d6473b22d756d92b98bf5e359c4fd6e4eb
Files changed
package-lock.json | changed |
package.json | changed |
plugs/message/html/render/gathering.js | changed |
package-lock.json | ||
---|---|---|
The diff is too large to show. Use a local git client to view these changes. Old file size: 296447 bytes New file size: 296780 bytes |
package.json | ||
---|---|---|
@@ -38,8 +38,9 @@ | ||
38 | 38 | "level": "~1.7.0", |
39 | 39 | "lrucache": "^1.0.2", |
40 | 40 | "micro-css": "^2.0.1", |
41 | 41 | "moment": "^2.18.1", |
42 | + "moment-timezone": "^0.5.17", | |
42 | 43 | "mutant": "^3.21.2", |
43 | 44 | "mutant-pull-reduce": "^1.1.0", |
44 | 45 | "obv": "0.0.1", |
45 | 46 | "patch-settings": "~1.1.0", |
plugs/message/html/render/gathering.js | ||
---|---|---|
@@ -1,9 +1,11 @@ | ||
1 | 1 | var { h, computed, when, map, send } = require('mutant') |
2 | 2 | var nest = require('depnest') |
3 | 3 | var extend = require('xtend') |
4 | -var moment = require('moment') | |
4 | +var moment = require('moment-timezone') | |
5 | 5 | |
6 | +var localTimezone = moment.tz.guess() | |
7 | + | |
6 | 8 | exports.needs = nest({ |
7 | 9 | 'message.html.markdown': 'first', |
8 | 10 | 'message.html.layout': 'first', |
9 | 11 | 'message.html.decorate': 'reduce', |
@@ -55,9 +57,9 @@ | ||
55 | 57 | h('button', { |
56 | 58 | 'ev-click': send(api.gathering.sheet.edit, msg.key) |
57 | 59 | }, 'Edit Details') |
58 | 60 | ]), |
59 | - h('div.time', computed(startDateTime, (time) => `${formatTime(time)} (your timezone)`)), | |
61 | + h('div.time', computed(startDateTime, formatTime)), | |
60 | 62 | when(image, h('a.image', { |
61 | 63 | href: imageId, |
62 | 64 | style: { |
63 | 65 | 'background-image': computed(imageUrl, (url) => `url(${url})`) |
@@ -151,9 +153,9 @@ | ||
151 | 153 | } |
152 | 154 | |
153 | 155 | function formatTime (time) { |
154 | 156 | if (time && time.epoch) { |
155 | - return moment(time.epoch).format('LLLL') | |
157 | + return moment(time.epoch).tz(localTimezone).format('LLLL zz') | |
156 | 158 | } |
157 | 159 | } |
158 | 160 | |
159 | 161 | function getAttendees (lookup) { |
Built with git-ssb-web