Fix inbox panel item timestamps.

Account for UTC offset.
This commit is contained in:
Jeff Stieler 2019-03-20 16:10:06 -06:00
parent 57957633f4
commit 244536e350
2 changed files with 4 additions and 2 deletions

View File

@ -30,7 +30,9 @@ class ActivityCard extends Component {
<H className="woocommerce-activity-card__title">{ title }</H> <H className="woocommerce-activity-card__title">{ title }</H>
{ subtitle && <div className="woocommerce-activity-card__subtitle">{ subtitle }</div> } { subtitle && <div className="woocommerce-activity-card__subtitle">{ subtitle }</div> }
{ date && ( { date && (
<span className="woocommerce-activity-card__date">{ moment( date ).fromNow() }</span> <span className="woocommerce-activity-card__date">
{ moment.utc( date ).fromNow() }
</span>
) } ) }
</header> </header>
<Section className="woocommerce-activity-card__body">{ children }</Section> <Section className="woocommerce-activity-card__body">{ children }</Section>

View File

@ -88,7 +88,7 @@ class InboxPanel extends Component {
key={ note.id } key={ note.id }
className="woocommerce-inbox-activity-card" className="woocommerce-inbox-activity-card"
title={ note.title } title={ note.title }
date={ note.date_created } date={ note.date_created_gmt }
icon={ <Gridicon icon={ note.icon } size={ 48 } /> } icon={ <Gridicon icon={ note.icon } size={ 48 } /> }
unread={ ! lastRead || new Date( note.date_created_gmt ).getTime() > lastRead } unread={ ! lastRead || new Date( note.date_created_gmt ).getTime() > lastRead }
actions={ getButtonsFromActions( note.actions ) } actions={ getButtonsFromActions( note.actions ) }