[IMP] pyeval: implement weekday function
courtesy of mva. This adds the weekday function to date objects in pyeval. This will be useful for adding better filters (such as this week) in the searchview.
This commit is contained in:
@@ -517,6 +517,9 @@
|
||||
toordinal: function () {
|
||||
return py.float.fromJSON(ymd2ord(this.year, this.month, this.day));
|
||||
},
|
||||
weekday: function () {
|
||||
return py.float.fromJSON((this.toordinal().toJSON()+6)%7);
|
||||
},
|
||||
fromJSON: function (year, month, day) {
|
||||
return py.PY_call(datetime.date, [year, month, day]);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user