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): writerOpts supports timeZone #1162

Conversation

takuminish
Copy link
Contributor

Hi there. I'm a user of this project.
Sorry... I use deepl because I am not good at English.

I've faced a problem that same as #594.

I created the PR because I thought it would be better to be able to set timeZone in writerOpts.

summary

add timezone option to writerOpts(#594 (comment))

The default value is 'UTC' to avoid breaking changes in the conventional-changelog-writer.

Usage

// option.js
export default {
    writerOpts: {
        timeZone: "Ameraica/Los_Angeles"
    }
}
$ conventional-changelog -p angular -i CHANGELOG.md -s  -n option.js

When a non-existent timezone is specified

When a non-existent timezone is specified, I get an error like the following.
Or should I catch the error?

// option.js
export default {
    writerOpts: {
        timeZone: "not_found"
    }
}
$ conventional-changelog -p angular -i CHANGELOG.md -s  -n option.js
RangeError: Invalid time zone specified: not_found
    at Intl.DateTimeFormat (<anonymous>)
    at dateFormatter...

If you like it, could you please review and merge this PR?
If further additional code or test is needed, we will accommodate.

@dangreen dangreen self-requested a review November 12, 2023 10:36
Copy link
Member

@dangreen dangreen left a comment

Choose a reason for hiding this comment

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

Thank you for the PR!

packages/conventional-changelog-writer/index.js Outdated Show resolved Hide resolved
packages/conventional-changelog-writer/test/index.spec.js Outdated Show resolved Hide resolved
packages/conventional-changelog-writer/README.md Outdated Show resolved Hide resolved
packages/conventional-changelog-writer/README.md Outdated Show resolved Hide resolved
@coveralls
Copy link

Coverage Status

coverage: 94.046% (+0.003%) from 94.043%
when pulling 5266d55 on takuminish:conventional-changelog-writer/add_timezone_option
into 7e51c6d on conventional-changelog:master.

@dangreen dangreen merged commit 27f3642 into conventional-changelog:master Nov 13, 2023
6 checks passed
@dangreen
Copy link
Member

@takuminish Thanks!

@takuminish
Copy link
Contributor Author

@dangreen Thanks for merging the PR!

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.

None yet

3 participants