Use Date object instead of seconds to set valid time of announcement
[MAILPOET-1525]
This commit is contained in:
@@ -30,7 +30,9 @@ class InAppAnnouncement extends React.Component {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (this.props.validUntil < (new Date().getTime() / 1000)) {
|
||||
if (this.props.validUntil !== null
|
||||
&& this.props.validUntil < new Date()
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -80,7 +82,7 @@ InAppAnnouncement.propTypes = {
|
||||
height: React.PropTypes.string,
|
||||
className: React.PropTypes.string,
|
||||
children: React.PropTypes.element.isRequired,
|
||||
validUntil: React.PropTypes.number,
|
||||
validUntil: React.PropTypes.instanceOf(Date),
|
||||
showToNewUser: (props, propName, componentName) => (
|
||||
validateBooleanWithWindowDependency(props, propName, componentName, 'mailpoet_is_new_user')
|
||||
),
|
||||
|
@@ -24,7 +24,7 @@ const ListingHeading = () => (
|
||||
showToPremiumUser={false}
|
||||
showOnlyOnceSlug="free_welcome_emails"
|
||||
height="650px"
|
||||
validUntil={new Date('2018-10-31').getTime() / 1000}
|
||||
validUntil={new Date('2018-10-31')}
|
||||
>
|
||||
<div className="mailpoet_in_app_announcement_free_welcome_emails">
|
||||
<h2>{MailPoet.I18n.t('freeWelcomeEmailsHeading')}</h2>
|
||||
|
Reference in New Issue
Block a user