Date Countdown Loop
Need some help to output a countdown...
The date is the first Monday in August every year and once its hits the day, reset...
Try this into an UNSTORED calculation field:
y = Year ( Get ( CurrentDate ) ) ;
first august monday = Date ( 8 ; Mod ( 2 - DayOfWeek ( Date ( 8 ; 1 ; y ) ) + 7 ; 7 ) + 1 ; y ) ;
next august monday = Date ( 8 ; Mod ( 2 - DayOfWeek ( Date ( 8 ; 1 ; y + 1 ) ) + 7 ; 7 ) + 1 ; y + 1 ) ;
first result = first august monday - Get ( CurrentDate ) ;
next result = next august monday - Get ( CurrentDate )
first result ≥ 0 ; first result ; next result
Thanks, that works perfectly...
Would it also be possible to add "Tomorrow" if 1 day remaining and "Today" if 0 day? Thanks again!
Yes, change the result type to text and the Case ( ) statement to:
first result = 0 ; "Today" ;
first result = 1 ; "Tomorrow" ;
first result ≥ 2 ; first result ;
Oh yes, thanks a bunch working great. Mind helping on one more? Trying to show date countdown until Chinese New Year... The dates are all over the place, is there a way I can hard code in like 10 years worth of them? I would also like to output the same Today, Tomorrow, and additionally the duration of the holiday, each time its 15 days.
Feb. 16 - 3
Feb. 17 - 2
Feb. 18 - Tomorrow
Feb. 19 - Today
Feb 18 - 30 Days Remaining
Feb 19 - 29 Days Remaining
Feb 20 - 28 Days Remaining
On day 0 should reset to the next year.
Retrieving data ...