Skip to content

fix: .utcOffset(0, true) result and its clone are different - #2505

Merged
iamkun merged 1 commit into
iamkun:devfrom
ostgals:fix_utc_utc-offset
Aug 27, 2025
Merged

iamkun merged 1 commit into
iamkun:devfrom
ostgals:fix_utc_utc-offset

Conversation

@ostgals

@ostgals ostgals commented Nov 15, 2023

Copy link
Copy Markdown
Contributor

Actually .utcOffset(0, flag) is the same as .utc(flag) but .utcOffset with keepLocalTime = true didn't modify the internal date accordingly. That caused a bug described in #2501

Fixed .utcOffset by returning .utc(keepLocalTime) if passed offset is zero.

Added some tests to cover possible mismatches.

@iamkun iamkun changed the title Fix: .utcOffset(0, true) result and its clone are different fix: .utcOffset(0, true) result and its clone are different Aug 27, 2025
@iamkun

iamkun commented Aug 27, 2025

Copy link
Copy Markdown
Owner

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants