Merge branch 'master' of github.com:nylas/N1

This commit is contained in:
Jackie Luo 2016-01-19 16:56:25 -08:00
commit 143ec77bf7
3 changed files with 7 additions and 7 deletions

2
N1.sh
View file

@ -22,5 +22,5 @@ if [ ! -e "$ELECTRON_PATH" ]; then
exit 1
fi
$ELECTRON_PATH --executed-from="$(pwd)" --pid=$$ "$@" $N1_PATH
$ELECTRON_PATH --executed-from="$(pwd)" --pid=$$ $N1_PATH "$@"
exit $?

View file

@ -28,10 +28,10 @@ class MessageTimestamp extends React.Component
diff = now.diff(msgDate, 'days', true)
isSameDay = now.isSame(msgDate, 'days')
if diff < 1 and isSameDay
return msgDate.format "h:mm a"
return msgDate.format "h:mm A"
if diff < 1.5 and not isSameDay
timeAgo = msgDate.from now
monthAndDay = msgDate.format "h:mm a"
monthAndDay = msgDate.format "h:mm A"
return monthAndDay + " (" + timeAgo + ")"
if diff >= 1.5 and diff < 365
return msgDate.format "MMM D"

View file

@ -4,7 +4,7 @@ TestUtils = React.addons.TestUtils
MessageTimestamp = require '../lib/message-timestamp'
msgTime = ->
moment([2010, 1, 14, 15, 25, 50, 125]) # Feb 14, 2010 at 3:25pm
moment([2010, 1, 14, 15, 25, 50, 125]) # Feb 14, 2010 at 3:25 PM
describe "MessageTimestamp", ->
beforeEach ->
@ -23,14 +23,14 @@ describe "MessageTimestamp", ->
it "displays the time from messages shown today", ->
now = msgTime().add(2, 'hours')
expect(@item._formattedDate(msgTime(), now)).toBe "3:25 pm"
expect(@item._formattedDate(msgTime(), now)).toBe "3:25 PM"
it "displays the time from messages yesterday with the relative time if it's less than 36 hours ago", ->
now = msgTime().add(21, 'hours')
expect(@item._formattedDate(msgTime(), now)).toBe "3:25 pm (21 hours ago)"
expect(@item._formattedDate(msgTime(), now)).toBe "3:25 PM (21 hours ago)"
now = msgTime().add(30, 'hours')
expect(@item._formattedDate(msgTime(), now)).toBe "3:25 pm (a day ago)"
expect(@item._formattedDate(msgTime(), now)).toBe "3:25 PM (a day ago)"
it "displays month, day for messages less than a year ago, but more than 24 hours ago", ->
now = msgTime().add(2, 'months')