2015年10月20日 星期二

使用 java 建立一個 日曆 Create your own Calendar (Date/Time) library from scratch using Java

使用 java 建立一個 日曆


Joann Mistica
Joined 11 months ago from The Philippines
Also follow me on:
report
I'm a 24-year old software engineer.

I have a very curious mind especially when it comes to how things work. I'm also enthusiastic for experiments and building things from scratch.

Some of my interests are programming, pixel art, comics, writing, rock music, and video games. I see code as a piece of art and try, as weird as it sounds, to make my masterpiece.


I like command lines and ASCII art. I find the old graphical user interfaces fascinating.


Create your own Calendar (Date/Time) library from scratch using Java





Method
Purpose
nextYear()
Returns the year after a given year.
nextDay()
Returns the next day.
nextDate()
Returns the full date (day, month, and year) after a given full date.


Method
Purpose
countDaysBetween()
Returns the number of days between two dates.
countMonthsBetween()
Returns the number of months between two dates.
countYearsBetween()
Returns the number of years between two dates.


Method
Purpose
countDaysBetween()
Returns the number of days between two dates.
countMonthsBetween()
Returns the number of months between two dates.
countYearsBetween()
Returns the number of years between two dates.



Method
Purpose
nameOfDay()
Checks which day of the week the date falls on.
addDays()
Adds days to a given date.
addMonths()
Adds months to a given date.
addYears()
Adds years to a given date.



Method
Purpose
displayCalendar()
Displays the ASCII calendar.
monthHeader()
Generates headers for each month.
dayHeader()
Generates headers for each day of the week.
line()
Creates a line to separate the headers from the actual days.
monthFiller()
Creates a unique filler for each month.
filler()
Generates the whole template and containers for each day to replace.
formatDay()
Formats the day to strictly have two digits.
indents()
Creates an indentation for every starting date or first day of the month.
fillerValues()
Adds the actual values to the template.





沒有留言: