mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-13 16:54:40 +08:00
Merge branch 'master' of github.com:nylas/N1
This commit is contained in:
commit
955e8b899f
3 changed files with 7 additions and 7 deletions
2
N1.sh
2
N1.sh
|
@ -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 $?
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue