You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the formatDistanceToNowStrict function from date-fns to calculate the distance to the current time from a date that is exactly one week ago, the output is incorrectly displayed as “7 days” instead of “1 week”.
Steps to Reproduce:
Subtract 7 days worth of seconds from the current date to simulate a date that is one week in the past.
Use the formatDistanceToNowStrict function to calculate the distance to now from this past date.
Observe the output logged to the console.
Expected Result:
The output should be “1 week” to accurately reflect the duration of one week.
Actual Result:
The output is “7 days”, which does not align with the expected week-based formatting.
Code to Reproduce:
constdate=subSeconds(newDate(),7*24*60*60);constoutput=formatDistanceToNowStrict(date);console.log('DEBUG output: ',output);// DEBUG output: 7 days
Additional Information:
date-fns: 3.6.0
The text was updated successfully, but these errors were encountered:
Description:
When using the
formatDistanceToNowStrict
function fromdate-fns
to calculate the distance to the current time from a date that is exactly one week ago, the output is incorrectly displayed as “7 days” instead of “1 week”.Steps to Reproduce:
formatDistanceToNowStrict
function to calculate the distance to now from this past date.Expected Result:
The output should be “1 week” to accurately reflect the duration of one week.
Actual Result:
The output is “7 days”, which does not align with the expected week-based formatting.
Code to Reproduce:
Additional Information:
The text was updated successfully, but these errors were encountered: