X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0eae5d09992c634488c5be14d5a378d6e1dedb71..03dc5fadefcef0fe2d3dde81611532d115eded30:/wxPython/src/_datetime.i?ds=sidebyside diff --git a/wxPython/src/_datetime.i b/wxPython/src/_datetime.i index 78b03d2e45..4a278dcd96 100644 --- a/wxPython/src/_datetime.i +++ b/wxPython/src/_datetime.i @@ -78,7 +78,7 @@ public: GMT_6, GMT_5, GMT_4, GMT_3, GMT_2, GMT_1, GMT0, GMT1, GMT2, GMT3, GMT4, GMT5, GMT6, - GMT7, GMT8, GMT9, GMT10, GMT11, GMT12, + GMT7, GMT8, GMT9, GMT10, GMT11, GMT12, GMT13, // Europe WET = GMT0, // Western Europe Time @@ -108,10 +108,14 @@ public: // Australia A_WST = GMT8, // Western Standard Time - A_CST = GMT12 + 1, // Central Standard Time (+9.5) + A_CST = GMT13 + 1, // Central Standard Time (+9.5) A_EST = GMT10, // Eastern Standard Time A_ESST = GMT11, // Eastern Summer Time + // New Zealand + NZST = GMT12, // Standard Time + NZDT = GMT13, // Daylight Saving Time + // Universal Coordinated Time = the new and politically correct name // for GMT UTC = GMT0 @@ -460,6 +464,10 @@ public: // resets time to 00:00:00, doesn't change the date wxDateTime& ResetTime(); + // get the date part of this object only, i.e. the object which has the + // same date as this one but time of 00:00:00 + wxDateTime GetDateOnly() const; + // the following functions don't change the values of the other // fields, i.e. SetMinute() won't change either hour or seconds value @@ -502,10 +510,6 @@ public: int n = 1, Month month = Inv_Month, int year = Inv_Year); -// wxDateTime GetWeekDay(WeekDay weekday, -// int n = 1, -// Month month = Inv_Month, -// int year = Inv_Year); // sets to the last weekday in the given month, year bool SetToLastWeekDay(WeekDay weekday, @@ -515,17 +519,6 @@ public: Month month = Inv_Month, int year = Inv_Year); - // sets the date to the given day of the given week in the year, - // returns True on success and False if given date doesn't exist (e.g. - // numWeek is > 53) - bool SetToTheWeek(wxDateTime_t numWeek, WeekDay weekday = Mon, WeekFlags flags = Monday_First); - wxDateTime GetWeek(wxDateTime_t numWeek, WeekDay weekday = Mon, WeekFlags flags = Monday_First); - - %pythoncode { - SetToTheWeek = wx._deprecated(SetToTheWeek, "SetToTheWeek is deprecated, use (static) SetToWeekOfYear instead") - GetWeek = wx._deprecated(GetWeek, "GetWeek is deprecated, use GetWeekOfYear instead") - } - // returns the date corresponding to the given week day of the given // week (in ISO notation) of the specified year static wxDateTime SetToWeekOfYear(int year, @@ -617,8 +610,10 @@ public: // is the date valid (True even for non initialized objects)? inline bool IsValid() const; - %pythoncode { Ok = IsValid } - %pythoncode { def __nonzero__(self): return self.Ok() }; + %pythoncode { IsOk = IsValid } + %pythoncode { Ok = IsOk } + + %pythoncode { def __nonzero__(self): return self.IsOk() }; // get the number of seconds since the Unix epoch - returns (time_t)-1 @@ -901,7 +896,6 @@ public: %property(RataDie, GetRataDie, doc="See `GetRataDie`"); %property(Second, GetSecond, SetSecond, doc="See `GetSecond` and `SetSecond`"); %property(Ticks, GetTicks, doc="See `GetTicks`"); - %property(Week, GetWeek, doc="See `GetWeek`"); %property(WeekDay, GetWeekDay, doc="See `GetWeekDay`"); %property(WeekDayInSameWeek, GetWeekDayInSameWeek, doc="See `GetWeekDayInSameWeek`"); %property(WeekOfMonth, GetWeekOfMonth, doc="See `GetWeekOfMonth`"); @@ -1063,6 +1057,13 @@ public: def __str__(self): return self.Format().encode(wx.GetDefaultPyEncoding()) } + + %property(days, GetDays, doc="See `GetDays`"); + %property(hours, GetHours, doc="See `GetHours`"); + %property(milliseconds, GetMilliseconds, doc="See `GetMilliseconds`"); + %property(minutes, GetMinutes, doc="See `GetMinutes`"); + %property(seconds, GetSeconds, doc="See `GetSeconds`"); + %property(weeks, GetWeeks, doc="See `GetWeeks`"); }; @@ -1189,11 +1190,11 @@ public: bool __ne__(const wxDateSpan* other) { return other ? (*self != *other) : true; } } - %property(Days, GetDays, SetDays, doc="See `GetDays` and `SetDays`"); - %property(Months, GetMonths, SetMonths, doc="See `GetMonths` and `SetMonths`"); - %property(TotalDays, GetTotalDays, doc="See `GetTotalDays`"); - %property(Weeks, GetWeeks, SetWeeks, doc="See `GetWeeks` and `SetWeeks`"); - %property(Years, GetYears, SetYears, doc="See `GetYears` and `SetYears`"); + %property(days, GetDays, SetDays, doc="See `GetDays` and `SetDays`"); + %property(months, GetMonths, SetMonths, doc="See `GetMonths` and `SetMonths`"); + %property(totalDays, GetTotalDays, doc="See `GetTotalDays`"); + %property(weeks, GetWeeks, SetWeeks, doc="See `GetWeeks` and `SetWeeks`"); + %property(years, GetYears, SetYears, doc="See `GetYears` and `SetYears`"); };