Project

General

Profile

Actions

Bug #19295

closed

Time#wday returns 7

Added by akostadinov (Aleksandar Kostadinov) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
[ruby-core:111570]

Description

This issue happens since Ruby 2.7, since Z and UTC are allowed for a zone.

[1] pry(main)> Time.new(2023, 1,3,0,0,0,"UTC").wday
=> 7
[2] pry(main)> Time.new(2023, 1,3,0,0,0,"Z").wday
=> 7

This also breaks all weekday Time#monday?, etc. methods.


Related issues 1 (0 open1 closed)

Is duplicate of Ruby master - Bug #19292: Time object's wday, yday, and isdst returns broken value (and so does to_a) when kwarg in: 'UTC' was givenClosedActions
Actions #1

Updated by nobu (Nobuyoshi Nakada) over 1 year ago

  • Is duplicate of Bug #19292: Time object's wday, yday, and isdst returns broken value (and so does to_a) when kwarg in: 'UTC' was given added

Updated by nobu (Nobuyoshi Nakada) over 1 year ago

  • Status changed from Open to Closed

Seems same as #19291.

Updated by akostadinov (Aleksandar Kostadinov) over 1 year ago

nobu (Nobuyoshi Nakada) wrote in #note-2:

Seems same as #19292.

In #19292 it is said that 3.0 and 2.7 don't need while they do.

Updated by nobu (Nobuyoshi Nakada) over 1 year ago

  • Backport changed from 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN to 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED, 3.2: REQUIRED

The patch conflicted with 2.7, but could fix this issue by applying with preceding patches.

Actions #5

Updated by naruse (Yui NARUSE) over 1 year ago

  • Backport changed from 2.7: REQUIRED, 3.0: REQUIRED, 3.1: REQUIRED, 3.2: REQUIRED to 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONTNEED
Actions

Also available in: Atom PDF

Like1
Like0Like0Like0Like0Like0