Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/next-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 7 additions & 1 deletion src/date/iso-date.ts
Original file line number Diff line number Diff line change
@@ -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 */
Expand All @@ -13,3 +18,4 @@ Object.defineProperty(Date.prototype, "toISOStringDate", {
configurable: false,
enumerable: false
});

9 changes: 8 additions & 1 deletion src/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<K, V> {
Expand Down