Skip to content
Snippets Groups Projects
Commit 4437f1fd authored by Yoan VALLET's avatar Yoan VALLET
Browse files

feat: use ceil on diffDays

parent 710c2a74
Branches
No related tags found
3 merge requests!103Support,!102Dev,!98Features/us213 recoil
......@@ -23,8 +23,8 @@ const ChallengeViewingDate: React.FC<ChallengeViewingDateProps> = ({
null
)
const diffDays =
firstDateWithData &&
firstDateWithData.diffNow(['days', 'hours']).toObject().days
firstDateWithData && firstDateWithData.diffNow(['days']).toObject().days
const diffDaysCeil = Math.ceil(diffDays || 0)
useEffect(() => {
if (challenge) {
......@@ -44,14 +44,11 @@ const ChallengeViewingDate: React.FC<ChallengeViewingDateProps> = ({
/* eslint-disable @typescript-eslint/camelcase */
return (
<React.Fragment>
{firstDateWithData &&
firstDateWithData > DateTime.local() &&
diffDays &&
diffDays > 0 ? (
{firstDateWithData && firstDateWithData > DateTime.local() ? (
<div className="view-start-date">
{t('CHALLENGE.VIEW_START', {
diffDays,
smart_count: diffDays,
diffDaysCeil,
smart_count: diffDaysCeil,
})}
</div>
) : (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment