Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(conventional-changelog-writer)!: formatDate option #1189

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

dangreen
Copy link
Member

BREAKING CHANGES: timeZone option was removed, please use formatDate option to change timezone of a date.

closes #1186

BREAKING CHANGES: `timeZone` option was removed, please use `formatDate` option to change timezone of a date.

closes #1186
@coveralls
Copy link

Coverage Status

coverage: 94.75% (-0.009%) from 94.759%
when pulling a775ce6 on feat-ccw-format-date-option
into 4d15052 on master.

@dangreen dangreen merged commit 8c4bbbe into master Dec 22, 2023
6 checks passed
@dangreen dangreen deleted the feat-ccw-format-date-option branch December 22, 2023 21:54
Comment on lines -16 to -24
export function formatDate(date?: string | number | Date, timeZone = 'UTC') {
const dateFormatter = !timeZone || timeZone === 'UTC'
? utcDateFormatter
: Intl.DateTimeFormat('sv-SE', {
timeZone
})

// sv-SEis used for yyyy-mm-dd format
return dateFormatter.format(date ? new Date(date) : new Date())
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good riddance!

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.

Misuse of Swedish Locale (conventional-changelog-writer/src/utils.ts)
3 participants