[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:
parent
a0e775e3fa
commit
af8c2e4db6
|
@ -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]);
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue