Last active
August 19, 2016 01:04
-
-
Save 178inaba/bbed2e7eb42e4755fffbc4865faa3401 to your computer and use it in GitHub Desktop.
古いnode.js(0.10.x)でMoment.jsのプラグインとMoment Timezoneを共存させる方法 ref: http://qiita.com/178inaba/items/4ac5161b1a6be9055df0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
moment = require 'moment-timezone' | |
require 'moment-round' | |
# ... | |
getFilename = -> | |
moment() | |
.tz('Asia/Tokyo') | |
.floor(5, 'minutes') | |
# ^ <- ここ | |
.format('YYYYMMDDHHmm') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
... | |
"engines": { | |
- "node": "0.10.x" | |
+ "node": "6.3.1" | |
+ "npm": "3.10.3" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
momentTimezone = require 'moment-timezone' | |
moment = require 'moment' | |
require 'moment-round' | |
# ... | |
getFilename = -> | |
tokyo = momentTimezone().tz('Asia/Tokyo') | |
moment(tokyo).floor(5, 'minutes').format('YYYYMMDDHHmm') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment