Skip to content

Instantly share code, notes, and snippets.

@thedeeno
Forked from anonymous/mozaik getDate
Created August 2, 2010 20:11
Show Gist options
  • Save thedeeno/505229 to your computer and use it in GitHub Desktop.
Save thedeeno/505229 to your computer and use it in GitHub Desktop.
var today_date:Date = new Date();
//
var date_Day:Number = (today_date.getDate());
var date_Month:Number = (today_date.getMonth()+1);
var date_Year:Number = (today_date.getYear());
//
//
// ( 8/21 - 10/31 ) …this fall
if ((date_Month>=8) and (date_Month<=9)) {
if ((date_Day>=21) and (date_Day<=31)){
gotoAndStop("fall");
}
}
// ( 11/1 - 12/31 ) …this holiday season
if ((date_Month>=11) and (date_Month<=12)) {
if ((date_Day>=1) and (date_Day<=31)){
gotoAndStop("holiday");
}
}
// ( 01/1 - 03/20 ) …this winter
if ((date_Month>=1) and (date_Month<=3)) {
if ((date_Day>=2) and (date_Day<=20)){
gotoAndStop("winter");
}
}
// ( 03/21 - 05/17 ) …this spring
if ((date_Month>=3) and (date_Month<=5)) {
if ((date_Day>=21) and (date_Day<=17)){
gotoAndStop("spring");
}
}
// ( 05/18 - 05/31 ) …this Memorial Day
if (date_Month==5) {
if ((date_Day>=18) and (date_Day<=31)){
gotoAndStop("memorial");
}
}
// ( 06/1 - 07/4 ) …this 4th of July
if ((date_Month>=6) and (date_Month<=7)) {
if ((date_Day>=1) and (date_Day<=4)){
gotoAndStop("july4th");
}
}
// ( 07/5 - 08/22 ) …this summer
if ((date_Month>=7) and (date_Month<=8)) {
if ((date_Day>=5) and (date_Day<=22)){
gotoAndStop("summer");
}
}
// ( 08/23 - 09/6 ) …this Labor Day
if ((date_Month>=8) and (date_Month<=9)) {
if ((date_Day>=23) and (date_Day<=6)){
gotoAndStop("laborday");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment