-
Hello. Is there a way to display a specific week number by subtracting it from the difference of today and a specified date in the past? Use case: Week number in college semester, starting September 06 2021 until today December 2, 2021 (Week 13) Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
slaughtr
Dec 10, 2021
Replies: 1 comment 2 replies
-
Using moment you can do this pretty easily
Math.abs() isn't necessary if your first date is ahead of your second IE you're looking back, but in the above example you get |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
rphlacilo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using moment you can do this pretty easily
Math.abs() isn't necessary if your first date is ahead of your second IE you're looking back, but in the above example you get
-1
- if you actually want to show negative weeks and positive, remove the Math.abs()