Answer the question
In order to leave comments, you need to log in
How to make it so that when the date 05/27/2020 18:19:47 is displayed, it writes “Last month” or “In May”?
There is a date in the format "05/27/2020 18:19:47".
How to make it so that when the date 05/27/2020 18:19:47 is displayed, it writes "Last month" or "In May".
Answer the question
In order to leave comments, you need to log in
You need to make a function that takes a month from your date, compare it with the current month and make a condition, if the difference === 1 then return "last month", if more, then "in ${ month }"
Well, month, respectively, incline need
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question