mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 18:32:20 +08:00
343e592569
Summary: Adds the draft list using a refactored list-tabular class. Also fixes several draft bugs that appeared after allowing editing. Test Plan: Run tests (need to test new ListTabular component ASAP) Reviewers: evan Reviewed By: evan Differential Revision: https://review.inboxapp.com/D1272
20 lines
456 B
CoffeeScript
20 lines
456 B
CoffeeScript
moment = require "moment"
|
|
React = require 'react'
|
|
|
|
module.exports =
|
|
timestamp: (time) ->
|
|
diff = moment().diff(time, 'days', true)
|
|
if diff <= 1
|
|
format = "h:mm a"
|
|
else if diff > 1 and diff <= 365
|
|
format = "MMM D"
|
|
else
|
|
format = "MMM D YYYY"
|
|
moment(time).format(format)
|
|
|
|
subject: (subj) ->
|
|
if (subj ? "").trim().length is 0
|
|
return <span className="no-subject">(No Subject)</span>
|
|
else
|
|
return subj
|
|
|