Skip to content

Fix Date.to_iso8601/2 loses :format with custom calendar - #15740

Merged
josevalim merged 1 commit into
elixir-lang:mainfrom
AlexGx:ag-date_to_iso8601_format-fix
Aug 13, 2026
Merged

Fix Date.to_iso8601/2 loses :format with custom calendar#15740
josevalim merged 1 commit into
elixir-lang:mainfrom
AlexGx:ag-date_to_iso8601_format-fix

Conversation

@AlexGx

@AlexGx AlexGx commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Date.to_iso8601/2 loses :format for date with non-ISO calendar

Current

iex> date = Calendar.Holocene.date(12001, 1, 1)
~D[12001-01-01 Calendar.Holocene]

iex> Date.to_iso8601(date, :extended)
"2001-01-01"
iex> Date.to_iso8601(date, :basic)
"2001-01-01"

Expected

iex> Date.to_iso8601(date, :basic)
"20010101"

Changes

  • preserve format fix
  • tests added

@josevalim
josevalim merged commit bc7844c into elixir-lang:main Aug 13, 2026
15 checks passed
@josevalim

Copy link
Copy Markdown
Member

💚 💙 💜 💛 ❤️

@AlexGx
AlexGx deleted the ag-date_to_iso8601_format-fix branch August 13, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants