Open artemklevtsov opened 4 years ago
@artemklevtsov Sorry for late response. Yes, you are welcome to make PR, although I think it could be improved even further to avoid using POSIXlt
and operate only on integer, not even POSIXct
. Change will be of course more complex. I think @MichaelChirico used these kid of arithmetic recently when writing datetime parser for fread.
Also when pasting benchmark timings, please align units they are being presented in. Otherwise it is not easy to compare values across rows.
Helpful links for the date math:
Suggestions
Add
trunc.IDate
(may be replaceround.IDate
) to consists withlubridate::floor_date
.trunc/floor
for the week should return first day of the week and not relate with the day of year.For the "weeks" unit add additional option for the
start.on.monday
(likecut.Date
) or something like this.Possible implementation:
Improvements
For the existing
round.IDate
implementation.Utility function to print bench results:
Data to process.
Weeks
Months
Qurters
Years
Final
trunc.IDate
implementation:Can I make the PR with this changes?