• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythongamewindowsbathyscaphephpguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

electron based twitter client


Commit MetaInfo

修订版6378647b1447c7ee7c0d578c1326fc4e40c507d4 (tree)
时间2016-02-08 19:06:03
作者hylom <hylom@user...>
Commiterhylom

Log Message

format timestamp with moment.js

更改概述

差异

--- a/package.json
+++ b/package.json
@@ -23,6 +23,7 @@
2323 "electron-prebuilt": "^0.36.0",
2424 "jquery": "2.2.0",
2525 "twitter": "1.2.5",
26- "ejs": "2.4.1"
26+ "ejs": "2.4.1",
27+ "moment": "2.11.2"
2728 }
2829 }
--- a/view.js
+++ b/view.js
@@ -1,6 +1,7 @@
11 var util = require('util');
22 var $ = require('jquery');
33 var ejs = require('ejs');
4+var moment = require('moment');
45
56 function sprnkrViewMain () {
67 var tweetWriter = {};
@@ -10,7 +11,7 @@ function sprnkrViewMain () {
1011 }
1112 var tweetData = {
1213 name: tweet.user.name + ' (@' + tweet.user.screen_name + ')',
13- timestamp: tweet.created_at,
14+ timestamp: moment(tweet.created_at).format('YYYY-MM-DD hh:mm:ss'),
1415 text: tweet.text,
1516 iconUrl: tweet.user.profile_image_url
1617 }