Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Prints the months in order, starting with the current month
- #
- # By Kyle Brodie
- set d to month of (current date) as integer
- set str to ""
- set str to str & numToDate(d)
- repeat with index from 1 to (12 - d)
- set str to str & " " & numToDate((d + index))
- end repeat
- repeat with index from 1 to (d - 1)
- set str to str & " " & numToDate(index)
- end repeat
- return str
- on numToDate(num)
- if num = 0 then
- return "ERROR"
- else if num = 1 then
- return "Jan"
- else if num = 2 then
- return "Feb"
- else if num = 3 then
- return "Mar"
- else if num = 4 then
- return "Apr"
- else if num = 5 then
- return "May"
- else if num = 6 then
- return "June"
- else if num = 7 then
- return "July"
- else if num = 8 then
- return "Aug"
- else if num = 9 then
- return "Sept"
- else if num = 10 then
- return "Oct"
- else if num = 11 then
- return "Nov"
- else if num = 12 then
- return "Dec"
- end if
- end numToDate
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement