Modify

Opened 13 years ago

Closed 13 years ago

#1859 closed Bug (Fixed)

Bug in _WeekNumberISO?

Reported by: Tweaky Owned by: Gary
Milestone: Component: Standard UDFs
Version: 3.3.6.1 Severity: None
Keywords: Cc:

Description

Hi,
is it possible, that there is a bug in _WeekNumberISO?
When I run this script I get the week of 01.01. for the year

#include <Date.au3>
For $i = 2011 To 2030

$x = _WeekNumberISO($i, 01, 01)
ConsoleWrite($i & @TAB & $x & @CRLF)

Next

The Result is
2011 52
2012 0
2013 1
2014 1
2015 53
2016 52
2017 0
2018 1
2019 1
2020 1
2021 53
2022 52
2023 0
2024 1
2025 1
2026 53
2027 52
2028 52
2029 1
2030 1

It looks like, that the result is 0 when the 01.01 is a sunday.

Attachments (0)

Change History (5)

comment:1 Changed 13 years ago by mvg

Forum is for questions.

comment:2 Changed 13 years ago by Tweaky

This is not a question.
I think this is a bug in the function.

comment:3 Changed 13 years ago by mvg

? -> question.

Anyway.
There are no zero weeks -> Bug.

Don't know ISO-date specs ... possible the weeks returned on other dates near the year switch might be incorrect to. (seems that way to me.)

The thing that makes me wonder here is the following difference.
Autoit:

@WDAY : Numeric day of week. Range is 1 to 7 which corresponds to Sunday through Saturday.

(starting with Sunday)

http://en.wikipedia.org/wiki/ISO_week_date:

weekday number, a digit d from 1 through 7, beginning with Monday and ending with Sunday.

(starting with Monday)

comment:4 Changed 13 years ago by Jon

  • Component changed from AutoIt to Standard UDFs
  • Owner set to Gary

comment:5 Changed 13 years ago by Jpm

  • Resolution set to Fixed
  • Status changed from new to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Gary.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.