From 6402b688f96bbdc101f0fa27f12c613efbaab1fd Mon Sep 17 00:00:00 2001 From: Michael Sambol Date: Thu, 21 Mar 2024 21:07:15 -0600 Subject: [PATCH 1/3] chore(core): clarify support for ISO duration --- packages/aws-cdk-lib/core/lib/duration.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/aws-cdk-lib/core/lib/duration.ts b/packages/aws-cdk-lib/core/lib/duration.ts index 9e32fbb89d391..90ebda08dea94 100644 --- a/packages/aws-cdk-lib/core/lib/duration.ts +++ b/packages/aws-cdk-lib/core/lib/duration.ts @@ -62,6 +62,9 @@ export class Duration { /** * Parse a period formatted according to the ISO 8601 standard * + * Days are the largest ISO duration supported, i.e., + * months and years are not supported. + * * @see https://www.iso.org/standard/70907.html * @param duration an ISO-formatted duration to be parsed. * @returns the parsed `Duration`. From b007d3d5316b99e983569270a99306a4052fc749 Mon Sep 17 00:00:00 2001 From: Michael Sambol Date: Fri, 22 Mar 2024 08:35:00 -0600 Subject: [PATCH 2/3] add feedback from Jimmy --- packages/aws-cdk-lib/core/lib/duration.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/core/lib/duration.ts b/packages/aws-cdk-lib/core/lib/duration.ts index 90ebda08dea94..92a3908559ae9 100644 --- a/packages/aws-cdk-lib/core/lib/duration.ts +++ b/packages/aws-cdk-lib/core/lib/duration.ts @@ -63,8 +63,9 @@ export class Duration { * Parse a period formatted according to the ISO 8601 standard * * Days are the largest ISO duration supported, i.e., - * months and years are not supported. + * weeks, months, and years are not supported. * + * @example 'P1DT2H3M4.567S' would represent 1 day, 2 hours, 3 minutes, 4 seconds, and 567 milliseconds. * @see https://www.iso.org/standard/70907.html * @param duration an ISO-formatted duration to be parsed. * @returns the parsed `Duration`. From 3e56e8384609639ca721fc8aa5021d129df3ad29 Mon Sep 17 00:00:00 2001 From: Michael Sambol Date: Fri, 22 Mar 2024 10:33:18 -0600 Subject: [PATCH 3/3] fix example --- packages/aws-cdk-lib/core/lib/duration.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/core/lib/duration.ts b/packages/aws-cdk-lib/core/lib/duration.ts index 92a3908559ae9..24e7b1ca0577b 100644 --- a/packages/aws-cdk-lib/core/lib/duration.ts +++ b/packages/aws-cdk-lib/core/lib/duration.ts @@ -65,7 +65,10 @@ export class Duration { * Days are the largest ISO duration supported, i.e., * weeks, months, and years are not supported. * - * @example 'P1DT2H3M4.567S' would represent 1 day, 2 hours, 3 minutes, 4 seconds, and 567 milliseconds. + * @example + * // This represents 1 day, 2 hours, 3 minutes, 4 seconds, and 567 milliseconds. + * 'P1DT2H3M4.567S' + * * @see https://www.iso.org/standard/70907.html * @param duration an ISO-formatted duration to be parsed. * @returns the parsed `Duration`.