https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17656
--- Comment #137 from Marcel de Rooy <[email protected]> --- You add a routine to DateUtils called issue_number: +my $week_number = issue_number('2017-01-01', 'week'); What you actually want is a day-of-week, week number or month. The name is confusing. I do not expect an issue_number in DateUtils. The POD is wrong since you expect a dt and raise an exception on a string. + return Day_of_Week(split /-/, $date->ymd); Please consider using a DateTime function here: $dt->day_of_week() $dt->wday() and $dt->dow(). $dt->local_day_of_week() Actually $dt->dow is shorter than issue_number($dt, 'week') + return $date->month; In this case it is more work to call issue_number($dt, 'month') than to say $dt->month. + my $dow = issue_number( dt_from_string($date), $frequency->unit ); This is a bit confusing. If we do not know the unit, how could we save it into dow (day of week) ? Rename ? I recommend to remove issue_number from DateUtils. We could move it to Serials? It is a thin wrapper to three DateTime methods. If you want to keep it in DateUtils, we should come up with a convincing name. -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
