Skip to content

Commit 2696548

Browse files
authored
Merge pull request #1087 from StoDevX/momentary-ceiling
Momentary ceiling
2 parents 602958f + 7434bc3 commit 2696548

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

source/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
// Tweak the global fetch
88
import './globalize-fetch'
9+
import './setup-moment'
910
import {tracker} from './analytics'
1011
import OneSignal from 'react-native-onesignal'
1112

source/setup-moment.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// @flow
2+
import moment from 'moment-timezone'
3+
4+
// These next values made possible by
5+
// http://stackoverflow.com/questions/42513276
6+
7+
// Tell Moment to round up, so that Moment will always report the
8+
// time until something else in a way that matches the clock time.
9+
// That is, at 5:22pm, Moment will report "8 minutes until 5:30pm"
10+
// until the clock ticks over to 5:23pm.
11+
// If we do Math.floor, we go the other direction: it will report
12+
// "7 minutes until 5:30pm" as soon as 5:22pm starts.
13+
moment.relativeTimeRounding(Math.ceil)
14+
15+
// Tell Moment that a minute is 60 seconds, for reporting purposes.
16+
// It defaults to 45 seconds.
17+
moment.relativeTimeThreshold('s', 60)

0 commit comments

Comments
 (0)