logo

const enum

sys::Month

sys::Obj
  sys::Enum
    sys::Month
  1  //
  2  // Copyright (c) 2006, Brian Frank and Andy Frank
  3  // Licensed under the Academic Free License version 3.0
  4  //
  5  // History:
  6  //   19 Sep 06  Brian Frank  Creation
  7  //
  8  
  9  **
 10  ** Enum for twelve months of the year.
 11  **
 12  enum Month
 13  {
 14    jan,
 15    feb,
 16    mar,
 17    apr,
 18    may,
 19    jun,
 20    jul,
 21    aug,
 22    sep,
 23    oct,
 24    nov,
 25    dec
 26  
 27    **
 28    ** Return the number of days in this month for the specified year.
 29    **
 30    Int numDays(Int year)
 31  
 32    **
 33    ** Return the month as a localized string according to the
 34    ** specified pattern.  The pattern rules are a subset of the
 35    ** `DateTime.toLocale`:
 36    **
 37    **    M      One/two digit month        6, 11
 38    **    MM     Two digit month            06, 11
 39    **    MMM    Three letter abbr month    Jun, Nov
 40    **    MMMM   Full month name            June, November
 41    **
 42    ** If pattern is null it defaults to "MMM".  Also see `localeAbbr`
 43    ** and `localeFull`.
 44    **
 45    Str toLocale(Str pattern := null)
 46  
 47    **
 48    ** Get the abbreviated name for the current locale.
 49    ** Configured by the 'sys::<name>Abbr' localized property.
 50    **
 51    Str localeAbbr()
 52  
 53    **
 54    ** Get the full name for the current locale.
 55    ** Configured by the 'sys::<name>Full' localized property.
 56    **
 57    Str localeFull()
 58  
 59  }