Skip to content

Conversation

@j0sm3n
Copy link

@j0sm3n j0sm3n commented Mar 26, 2024

When converting Date to String using predefined month styles, the function is returning incorrect values.

let date = Date() // 26/3/2024

date.toString(style: .month) // April
date.toString(style: .shortMonth) // Apr
date.toString(style: .veryShortMonth) // A

I fixed it with .toString(format: .custom(String)) for each case.

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.

1 participant