diff --git a/.github/workflows/main-deploy.yml b/.github/workflows/main-deploy.yml index fe96e9d..6ec749b 100644 --- a/.github/workflows/main-deploy.yml +++ b/.github/workflows/main-deploy.yml @@ -15,6 +15,7 @@ jobs: secrets: GH_DEPLOY_TOKEN: ${{ secrets.GH_DEPLOY_TOKEN }} NPM_ORG_OGS_GMBH_CI: ${{ secrets.NPM_ORG_OGS_GMBH_CI }} + MS_TEAMS_URL: ${{ secrets.MS_TEAMS_URL }} with: release_please_config_file: ".release-please/main-config.json" release_please_manifest_file: ".release-please/main-manifest.json" diff --git a/.github/workflows/next-deploy.yml b/.github/workflows/next-deploy.yml index 4feafbd..c684b96 100644 --- a/.github/workflows/next-deploy.yml +++ b/.github/workflows/next-deploy.yml @@ -15,6 +15,7 @@ jobs: secrets: GH_DEPLOY_TOKEN: ${{ secrets.GH_DEPLOY_TOKEN }} NPM_ORG_OGS_GMBH_CI: ${{ secrets.NPM_ORG_OGS_GMBH_CI }} + MS_TEAMS_URL: ${{ secrets.MS_TEAMS_URL }} with: release_please_config_file: ".release-please/next-config.json" release_please_manifest_file: ".release-please/next-manifest.json" diff --git a/src/date/iso-date.ts b/src/date/iso-date.ts index 1768831..d72cdad 100644 --- a/src/date/iso-date.ts +++ b/src/date/iso-date.ts @@ -1,4 +1,9 @@ -function toISOStringDate (this: Date): string { +function toISOStringDate (this: Date, isLocal: boolean = false): string { + if (isLocal) { + return `${ this.getFullYear() }-${ (this.getMonth() + 1).toString().padStart(2, "0") }-${ this.getDate().toString() + .padStart(2, "0") }`; + } + const ISO_TIME_SEPARATOR: string = "T"; /* eslint-disable-next-line @tseslint/no-non-null-assertion */ @@ -13,3 +18,4 @@ Object.defineProperty(Date.prototype, "toISOStringDate", { configurable: false, enumerable: false }); + diff --git a/src/public-api.ts b/src/public-api.ts index 37c9a28..d621e75 100644 --- a/src/public-api.ts +++ b/src/public-api.ts @@ -17,7 +17,14 @@ declare global { } interface Date { - toISOStringDate(): string; + /** + * @param isLocal Indicates whether the date should be returned in local time. If omitted, the date is returned in UTC. + * @returns date in ISO-8601 format (`YYYY-MM-DD`) + * + * @author Ian Wenneckers + * @since 1.1.0 + */ + toISOStringDate(isLocal?: boolean): string; } interface Map {