home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Bila Vrana
/
BILA_VRANA.iso
/
005A
/
FDATE91C.ZIP
/
HOLIDAYS.BAT
< prev
next >
Wrap
DOS Batch File
|
1995-10-22
|
7KB
|
202 lines
@echo off
CLS
:: HOLIDAYS.BAT
:: if user specifies a year as parm1, use it
:: revised 1994 Nov 06 to use new /J parm in version 8.8
set year=%1
if not (%year%)==() goto GetYrEnd
:: get name of this batch file, in upper case
FDATE /fupper /q%0 /v
:: show title between two lines of bars
fdate /fe /J"L─79" /P
fdate /fe /J"C 79" /P"%fdate%"
fdate /fe /J"L─79" /P
:GetYr
echo.
echo Please enter the year for which you want holidays calculated,
FDATE /fget /q"or press ENTER for current year > " /vyear
if not (%year%)==() goto GetYrEnd
:: get current year
Fdate /Ff /At /Occyy /vyear
:GetYrEnd
:: pad year to left with zeroes, to make sure it is 4 bytes long
Fdate /Fe /P%year% /JR04 /vyear
echo.
:: check for validity of year parm (%1)
Fdate /Fv /A01-01-%year% >nul
if errorlevel 1 echo Value [%year%] is not a valid year.
if errorlevel 1 goto Endit
:: --------------------------------------------------------
:: Determine if year is a leapyear
:: --------------------------------------------------------
Fdate /Ff /A01-01-%year% /Oly /vLY
cls
echo ───────────────────────────────────────────────────────────────────────────────
if (%LY%)==(0) ECHO EVENTS IN %YEAR%
if (%LY%)==(1) ECHO EVENTS IN %YEAR% Note: %year% is a leap year
ECHO To print the calendar, press SHIFT+PRINTSCREEN to print each screen.
echo ───────────────────────────────────────────────────────────────────────────────
Fdate /Fe /J"L.50" /Vtitle /P"New Year's Day"
Fdate /Ff /A01-01-%year% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"Epiphany"
Fdate /Ff /A01-06-%year% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"Martin Luther King, Jr. Day"
Fdate /Fw /D2 /N3 /A01-01-%year% /P"%title% "
:: note use of CENTER justification in next line
Fdate /Ff /A02-01-%year% /J"C 79" /P"Note that " /S" begins Black History Month"
Fdate /Fe /J"L.50" /Vtitle /P"Valentine's day"
Fdate /Ff /A02-14-%year% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"Presidents' Day"
Fdate /Fw /D2 /N3 /A02-01-%year% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"St. Patricks's Day"
Fdate /Ff /A03-17-%year% /P"%title% "
if (%LY%)==(1) Fdate /Fe /J"L.50" /Vtitle /P"Sadie Hawkins Day"
if (%LY%)==(1) Fdate /Ff /A02-29-%year% /P"%title% "
:: ========== begin: DATES TIED TO EASTER==============================
set easter=
if (%year%)==(1991) set easter=03-31-%year%
if (%year%)==(1992) set easter=04-19-%year%
if (%year%)==(1993) set easter=04-11-%year%
if (%year%)==(1994) set easter=04-03-%year%
if (%year%)==(1995) set easter=04-16-%year%
if (%year%)==(1996) set easter=04-07-%year%
if (%year%)==(1997) set easter=03-30-%year%
if (%year%)==(1998) set easter=04-12-%year%
if (%year%)==(1999) set easter=04-04-%year%
if (%year%)==(2000) set easter=04-23-%year%
if (%year%)==(2001) set easter=04-15-%year%
if (%easter%)==() goto unknown
echo.
Fdate /Fe /J"L.50" /Vtitle /P"Mardi Gras (Shrove Tuesday)"
Fdate /Fsub /N47 /A%easter% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"Ash Wednesday (Lent begins)"
Fdate /Fsub /N46 /A%easter% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"Palm Sunday"
Fdate /Fsub /N7 /A%easter% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"Good Friday"
Fdate /Fsub /N2 /A%easter% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"Easter"
Fdate /Ff /A%easter% /P"%title% "
:unknown
:: ========== end: DATES TIED TO EASTER==============================
echo ───────────────────────────────────────────────────────────────────────────────
PAUSE
CLS
Fdate /Fe /J"L.50" /Vtitle /P"Secretary's Day"
Fdate /Fw /D4 /N4 /A04-01-%year% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"Cinco de Mayo (Mexico)"
Fdate /Ff /A05-05-%year% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"Mother's Day"
Fdate /Fw /D1 /N2 /A05-01-%year% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"Victoria Day (Canada)"
Fdate /Fw /D2 /N-1 /A05-24-%year% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"Memorial Day (observed)"
Fdate /FW /D2 /N-1 /A05-31-%year% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"Ascension Day"
if not (%easter%)==() Fdate /Fadd /N39 /A%easter% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"Pentecost"
if not (%easter%)==() Fdate /Fadd /N49 /A%easter% /P"%title% "
if not (%easter%)==() echo.
Fdate /Fe /J"L.50" /Vtitle /P"Flag Day"
Fdate /Ff /A06-14-%year% /P"%title% "
:: ----- anniversary of Bloom's Day, June 16, 1904 ------------------
:: Here's a way to show an anniversary or event that you want to note.
:: Thanks to L. Schliesser for the algorithm.
:: ------------------------------------------------------------------
Fdate /F#dif /A%year% /B1904 /vann
Fdate /Fe /J"L.50" /Vtitle /P"Bloom's Day (%ann%th anniversary)"
Fdate /Ff /A06-16-%year% /P"%title% "
SET ann=
:: ---------------end bloom's day --------------------------------------
Fdate /Fe /J"L.50" /Vtitle /P"Father's Day"
Fdate /Ff /A07-01-%year% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"Independence Day (USA)"
Fdate /Ff /A07-04-%year% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"Bastille Day (France)"
Fdate /Ff /A07-14-%year% /P"%title% "
:: echo ─────────────────────────────────────────────────────────────────────── ────────
:: PAUSE
:: CLS
Fdate /Fe /J"L.50" /Vtitle /P"Labor Day"
Fdate /Fw /D2 /N1 /A09-01-%year% /P"%title% "
:: ---- begin ------- note a particular day in a particular year
:: This technique is useful for noting special events:
:: 21st birthdays, 50th wedding anniversaries, etc.
Fdate /Fe /J"L.50" /Vtitle /P"500th anniversary of Columbus's discovery"
if (%year%)==(1992) Fdate /Ff /A10-12-%year% /P"%title% "
:: ---- end -------- note a particular day in a particular year
Fdate /Fe /J"L.50" /Vtitle /P"Columbus Day (observed)"
Fdate /Fw /D2 /N2 /A10-01-%year% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"Thanksgiving Day (Canada)"
Fdate /Fw /D2 /N2 /A10-01-%year% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"Veteran's Day"
Fdate /Ff /A11-11-%year% /P"%title% "
:: Fourth Thursday in November
Fdate /Fe /J"L.50" /Vtitle /P"Thanksgiving Day (USA)"
Fdate /Fw /D5 /N4 /A11-01-%year% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"First Sunday in Advent"
Fdate /Fw /D1 /N-4 /A12-24-%year% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"Christmas"
Fdate /Ff /A12-25-%year% /P"%title% "
Fdate /Fe /J"L.50" /Vtitle /P"New Year's Day"
Fdate /fadd /N1 /A12-31-%year% /P"%title% "
echo ───────────────────────────────────────────────────────────────────────────────
:endit
set year=
set fdate=
set easter=
set title=
set LY=