Weekday.
Inheritance: Enum
Example #1
0
 internal DateTimeStr(string pattern, Locale locale, Date d)
 {
     this.pattern  = pattern;
       this.m_locale = locale;
       this.year     = d.getYear();
       this.mon      = d.month();
       this.day      = d.getDay();
       try { this.weekday = d.weekday(); } catch (Exception) {}
 }
Example #2
0
 //////////////////////////////////////////////////////////////////////////
 // Constructors
 //////////////////////////////////////////////////////////////////////////
 internal DateTimeStr(string pattern, Locale locale, DateTime dt)
 {
     this.pattern  = pattern;
       this.m_locale = locale;
       this.year     = dt.getYear();
       this.mon      = dt.month();
       this.day      = dt.getDay();
       this.hour     = dt.getHour();
       this.min      = dt.getMin();
       this.sec      = dt.getSec();
       this.ns       = dt.getNanoSec();
       this.weekday  = dt.weekday();
       this.tz       = dt.tz();
       this.dst      = dt.dst();
 }
Example #3
0
File: DateTime.cs Project: xored/f4
        internal static int weekOfYear(int year, int month, int day, Weekday startOfWeek)
        {
            int firstWeekday = DateTime.firstWeekday(year, 0); // zero based
              int lastDayInFirstWeek = 7 - (firstWeekday - startOfWeek.ord);

              // special case for first week
              if (month == 0 && day <= lastDayInFirstWeek) return 1;

              // compute from dayOfYear - lastDayInFirstWeek
              int doy = dayOfYear(year, month, day) + 1;
              int woy = (doy - lastDayInFirstWeek - 1) / 7;
              return woy + 2; // add first week and make one based
        }
Example #4
0
File: DateTime.cs Project: xored/f4
 public long weekOfYear(Weekday startOfWeek)
 {
     return weekOfYear(getYear(), month().ord, getDay(), startOfWeek);
 }
Example #5
0
File: DateTime.cs Project: xored/f4
 public static long weekdayInMonth(long year, Month mon, Weekday weekday, long pos)
 {
     return weekdayInMonth((int)year, mon.ord, weekday.ord, (int)pos);
 }
Example #6
0
 public long weekOfYear(Weekday startOfWeek)
 {
     return(DateTime.weekOfYear(getYear(), month().ord, getDay(), startOfWeek));
 }
Example #7
0
 public long weekOfYear()
 {
     return(weekOfYear(Weekday.localeStartOfWeek()));
 }
Example #8
0
 public static long weekdayInMonth(long year, Month mon, Weekday weekday, long pos)
 {
     return(weekdayInMonth((int)year, mon.ord, weekday.ord, (int)pos));
 }