Packageorg.libspark.utils
Classpublic class DateUtil

Date クラスのためのユーティリティクラスです



Public Methods
 MethodDefined by
  
convertJCalendar(fullyear:uint):String
[static] 西暦を和暦に変換します.
DateUtil
  
getFirstDay(fullyear:uint, month:uint):uint
[static] 指定の月の最初の曜日を調べます。
DateUtil
  
getMaxDateLength(date:Date):int
[static] 対象となる Date オブジェクトの月の最大日数を返します。
DateUtil
  
getMonthName(index:uint, type:uint = 0):String
[static] 月を示す文字列を返します.
DateUtil
  
getWeekName(index:uint, type:uint = 0):String
[static] 曜日名を取得します.
DateUtil
  
isLeap(fullyear:uint):Boolean
[static] うるう年かどうかを調べます.
DateUtil
Method detail
convertJCalendar()method
public static function convertJCalendar(fullyear:uint):String

西暦を和暦に変換します. 対応しているのは明治以降になります(1868年以降)

Parameters
fullyear:uint — 西暦

Returns
String — 和暦(例:H20)
getFirstDay()method 
public static function getFirstDay(fullyear:uint, month:uint):uint

指定の月の最初の曜日を調べます。

Parameters
fullyear:uint — 西暦
 
month:uint — 月

Returns
uint
getMaxDateLength()method 
public static function getMaxDateLength(date:Date):int

対象となる Date オブジェクトの月の最大日数を返します。

Parameters
date:Date — 最大日数を取得したい Date オブジェクトです。

Returns
int — 最大日数です。
getMonthName()method 
public static function getMonthName(index:uint, type:uint = 0):String

月を示す文字列を返します.
type の指定によって得られる値
0 : JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER
1 : January, February, March, April, May, June, July, August, September, October, November, December
2 : january, february, march, april, may, june, july, august, september, october, november, december
3 : JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
4 : Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec
5 : jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec
6 : 1月, 2月, 3月, 4月, 5月, 6月, 7月, 8月, 9月, 10月, 11月, 12月
7 : 睦月, 如月, 弥生, 卯月, 皐月, 水無月, 文月, 葉月, 長月, 神無月, 霜月, 師走

Parameters
index:uint — 月
 
type:uint (default = 0) — 取得する月名のタイプ(0から7まで)

Returns
String — 月名
getWeekName()method 
public static function getWeekName(index:uint, type:uint = 0):String

曜日名を取得します.
type の指定によって得られる値
0 : SUNDAY, MONDAY, TUSEDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY
1 : Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
2 : sunday, monday, tuesday, wednesday, thursday, friday, saturday
3 : SUN, MON, TUE, WED, THU, FRI, SAT
4 : Sun, Mon, Tue, Wed, Thu, Fri, Sat
5 : sun, mon, tue, wed, thu, fri, sat
6 : 日曜日, 月曜日, 火曜日, 水曜日, 木曜日, 金曜日, 土曜日
7 : 日, 月, 火, 水, 木, 金, 土

Parameters
index:uint — 曜日インデックス値
 
type:uint (default = 0) — 取得する曜日名のタイプ(0から7まで)

Returns
String — 曜日名
isLeap()method 
public static function isLeap(fullyear:uint):Boolean

うるう年かどうかを調べます.

Parameters
fullyear:uint — 西暦

Returns
Boolean — うるう年の場合はtrueを返します。