Comments (9)
Did you solve your problem?
Currently, my CI builds create the date in the header in the following format: mm/dd/yyyy
I don't know why but it seems to be related to the locale settings of the container. On my Mac it is still yyyy-mm-dd.
It would be nice to use a dedicated setting for the format or a hint in the documentation how to handle date format issues.
from release-notes-generator.
@peterhirn thanks a lot for your help . This works for me now it is working fine.
from release-notes-generator.
It seems like date
can't be configured at all?
The config value https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer#date is outside of the writerOpts
.
My config currently produces dates formatted like 2024-2-27
🤷
Edit: Found this function called formatDate
https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/conventional-changelog-writer/src/types/options.ts#L116, unfortunately it is never called...
Edit 2: I ended up using pnpm patch conventional-changelog-writer
to fix the formatting.
patches/[email protected]
diff --git a/index.js b/index.js
index 86e5add10bf78569c4e886c7ed3f8554acd80109..fb1d6f6034eaa5a207118a6088b11046fd2dabaa 100644
--- a/index.js
+++ b/index.js
@@ -23,7 +23,7 @@ async function conventionalChangelogWriterInit (context, options) {
context = {
commit: 'commits',
issue: 'issues',
- date: dateFormatter.format(new Date()),
+ date: new Date().toISOString().slice(0, 10),
...context
}
from release-notes-generator.
Hi @sac-cas I did not unfortunately, but I agree that a dedicated setting would be a nice addition.
from release-notes-generator.
Can you tell me if the package is added with the date formatter. thank you.
from release-notes-generator.
With the update of semantic-release
to v24 and conventional-changelog-conventionalcommits
to v8 the date format function was fixed.
const DATETIME_LENGTH = 10;
/**
* Formats date to yyyy-mm-dd format.
* @param date - Date string or Date object.
* @returns Date string in yyyy-mm-dd format.
*/
export function formatDate(date) {
return new Date(date).toISOString().slice(0, DATETIME_LENGTH);
}
The default format is now yyyy-mm-dd
regardless of the environment. I didn't test if a custom date format function can now be configured too.
from release-notes-generator.
yeah actually I am getting error, regarding the same. As the date recieved here is {} .
which is causing the command to get failed. Now I have check my commits date format they are normal. as they should be.
Can you help me with than what is causing this issue. @peterhirn
from release-notes-generator.
@ayushnau Looks like you are using the previous version of conventional-changelog-writer
. I think this is the case because in v8
the file node_modules/conventional-changelog-writer/index.js
doesn't exist (everything is in the dist
directory).
Check your package.json
file and maybe nuke your node_modules
and reinstall all dependencies.
"devDependencies": {
"@semantic-release/changelog": "6.0.3",
"@semantic-release/exec": "6.0.3",
"@semantic-release/git": "10.0.1",
"@semantic-release/gitlab": "13.1.0",
"conventional-changelog-conventionalcommits": "8.0.0",
"semantic-release": "24.0.0",
...
}
from release-notes-generator.
closing since it sounds like this is resolved. please feel free to leave additional comments if that is not the case in other scenarios
from release-notes-generator.
Related Issues (20)
- Sort commit sections HOT 11
- An error occurred while running semantic-release: Error [ERR_REQUIRE_ESM] HOT 7
- wrong Gitlab issue link in release notes HOT 20
- Plugin ends up abruptly without completition or error, making other plugins not to start HOT 12
- Wrong commit link for Bitbucket HOT 3
- `release skip`-ed commits still get into release notes
- Links to PRs and Contributors list HOT 2
- `MODULE_NOT_FOUND` when running with `npx` HOT 5
- Unexpected behavior for major updates with conventionalcommits preset HOT 2
- self-hosted GitLab - no issue links in release notes
- Question: Merging pre-release branches & generated changelog
- Question: Mirror release rules to release notes generator? HOT 1
- Question: how can i gruop no-scope commits on a section in release notes generator configuration ?
- conventional-changelog-conventionalcommits v8.0.0 breaks semantic release HOT 28
- Release notes not appearing on GitHub Release descriptions HOT 2
- Deprecated dependency read-pkg-up HOT 1
- TypeError: Method Date.prototype.toString called on incompatible receiver [object Date] HOT 2
- TypeError: Method Date.prototype.toString called on incompatible receiver [object Date] HOT 1
- custom `writerOpts` `transform` no longer able to modify section titles HOT 1
- semantic-release fails due to a crash in `conventional-changelog-writer` after updating to latest major versions HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from release-notes-generator.