File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
airbyte-webapp/src/packages/cloud/views/layout/MainView Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -65,11 +65,12 @@ const MainView: React.FC = (props) => {
65
65
} else if ( alertToShow === "trial" ) {
66
66
const { trialExpiryTimestamp } = cloudWorkspace ;
67
67
68
- //calculate difference between timestamp (in epoch seconds) and now (in epoch seconds)
69
- const trialRemainingSeconds = trialExpiryTimestamp ? trialExpiryTimestamp - Date . now ( ) / 1000 : 0 ;
68
+ //calculate difference between timestamp (in epoch milliseconds) and now (in epoch milliseconds)
69
+ //empty timestamp is 0
70
+ const trialRemainingMilliseconds = trialExpiryTimestamp ? trialExpiryTimestamp - Date . now ( ) : 0 ;
70
71
71
72
//calculate days (rounding up if decimal)
72
- const trialRemainingDays = Math . ceil ( trialRemainingSeconds / ( 24 * 60 * 60 ) ) ;
73
+ const trialRemainingDays = Math . ceil ( trialRemainingMilliseconds / ( 1000 * 60 * 60 * 24 ) ) ;
73
74
74
75
return formatMessage ( { id : "trial.alertMessage" } , { value : trialRemainingDays } ) ;
75
76
}
You can’t perform that action at this time.
0 commit comments