FORUMS: list search recent posts

Date Countdown - Skip Weekend Dates

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Eliaz Rodriguez
Date Countdown - Skip Weekend Dates
on May 11, 2017 at 9:53:41 pm

Hello, I tweaked Dan's date-countdown expression from this thread, dropping it into source text https://forums.creativecow.net/docs/forums/post.php?forumid=227&postid=1335... I needed it to show the calendar date and every 5 seconds go to the next date, starting at 4/24 continuing to infinity, which I accomplished. Although now I need it to also skip both weekend days. Does anyone know what I would need to add to this?

So I need to show 5 dates, then skip 2 dates, then show 5 dates, etc.

Show: 4/24, 4/25, 4/26, 4/27, 4/28
Skip: 4/29, 4/30
Show: 5/1, 5/2, 5/3, 5/4, 5/5
etc.

startDate = "Apr 24 2017";
endDate = "Apr 24 2017";
rate = .2; // counts per second

d1 = new Date(endDate);
d2 = new Date(startDate);
msPerDay = (24*60*60*1000)*-1;
t = Math.floor((time-inPoint)*rate);
ms = Math.max(d1.getTime() - t*msPerDay,d2);
d = new Date(ms);
mo = "" + (d.getMonth()+1);
dy = "" + d.getDate();
yr = "" + d.getFullYear();
if (dy.length &lt; 2) dy = "0" + dy;
mo+ "/" + dy


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]