Determine the week number of the next week, the first two parameters are input parameters, these are a year and a week number. The last two parameters are the year and week number of the next week. This predicate is useful when it is necessary to iterate through a number of weeks from a certain week number of a year.
There is also the predicate prev_week/4 to determine the week number of a previous week. This predicate is located in the file 'datetime.txt', use ensure_loaded/1 to include this file.
see also: age/7 day_number/4 day_of_week/2 datetime module decode_date/4 decode_datetime/7 decode_time/4 encode_date/4 encode_datetime/7 encode_time/2 encode_time/3 encode_time/4 ensure_loaded/1 first_week/2 leap_year/1 length_month/3 monday_of_week/3 monday_of_week/5 prev_week/4 reverse_day_number/4 start_of_week/3
| Example | |
| next_week(1998, 1, Y, W). | succeeds and the week and year numbers are: Y = 1998, W = 2 |
| next_week(1997, 52, Y, W). | succeeds, the next week of week 52 of 1997 is: Y = 1998, W = 1 |
| next_week(1998, 52, 1999, 1). | fails, because 1998 has 53 weeks |
| next_week(1999, 52, 2000, 1). | succeeds, because 1999 has 52 weeks |
| Exceptions | |
| The Year and/or WeekNumber parameters are not integers | a type_error(evaluable, Value) exception is thrown, Value is unified with the incorrect argument |