git ssb

10+

Matt McKegg / patchwork



Commit 5624a137f19bc508201cff6468ac5b3fffef93cf

Use timezone from moment instead of (your timezone)

Peter Squicciarini committed on 6/12/2018, 6:25:01 PM
Parent: acdcd1d6473b22d756d92b98bf5e359c4fd6e4eb

Files changed

package-lock.jsonchanged
package.jsonchanged
plugs/message/html/render/gathering.jschanged
package-lock.jsonView
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.jsonView
@@ -38,8 +38,9 @@
3838 "level": "~1.7.0",
3939 "lrucache": "^1.0.2",
4040 "micro-css": "^2.0.1",
4141 "moment": "^2.18.1",
42+ "moment-timezone": "^0.5.17",
4243 "mutant": "^3.21.2",
4344 "mutant-pull-reduce": "^1.1.0",
4445 "obv": "0.0.1",
4546 "patch-settings": "~1.1.0",
plugs/message/html/render/gathering.jsView
@@ -1,9 +1,11 @@
11 var { h, computed, when, map, send } = require('mutant')
22 var nest = require('depnest')
33 var extend = require('xtend')
4-var moment = require('moment')
4+var moment = require('moment-timezone')
55
6+var localTimezone = moment.tz.guess()
7+
68 exports.needs = nest({
79 'message.html.markdown': 'first',
810 'message.html.layout': 'first',
911 'message.html.decorate': 'reduce',
@@ -55,9 +57,9 @@
5557 h('button', {
5658 'ev-click': send(api.gathering.sheet.edit, msg.key)
5759 }, 'Edit Details')
5860 ]),
59- h('div.time', computed(startDateTime, (time) => `${formatTime(time)} (your timezone)`)),
61+ h('div.time', computed(startDateTime, formatTime)),
6062 when(image, h('a.image', {
6163 href: imageId,
6264 style: {
6365 'background-image': computed(imageUrl, (url) => `url(${url})`)
@@ -151,9 +153,9 @@
151153 }
152154
153155 function formatTime (time) {
154156 if (time && time.epoch) {
155- return moment(time.epoch).format('LLLL')
157+ return moment(time.epoch).tz(localTimezone).format('LLLL zz')
156158 }
157159 }
158160
159161 function getAttendees (lookup) {

Built with git-ssb-web