-
-
Couldn't load subscription status.
- Fork 80
Open
Labels
Priority: MediumThis issue may be useful, and needs some attention.This issue may be useful, and needs some attention.Status: In ProgressThis issue is being worked on, and has someone assigned.This issue is being worked on, and has someone assigned.Type: EnhancementMost issues will probably ask for additions or changes.Most issues will probably ask for additions or changes.
Description
Is your feature request related to a problem? Please describe.
PHP-native \DateInterval supports instantiating intervals from a duration string which is also perfectly aligned with standard XMLSchema's xs:duration format.
Describe the solution you'd like
/** @throws DateMalformedIntervalStringException */
$duration = Psl\DateTime\Duration::from('P1Y1M1D');
Describe alternatives you've considered
An alternative is either keep using \DateInterval or manually parsing which is error-prone anyway (Psl's highest granularity is 'hour', so it is on the user to convert years, months, days).
Metadata
Metadata
Assignees
Labels
Priority: MediumThis issue may be useful, and needs some attention.This issue may be useful, and needs some attention.Status: In ProgressThis issue is being worked on, and has someone assigned.This issue is being worked on, and has someone assigned.Type: EnhancementMost issues will probably ask for additions or changes.Most issues will probably ask for additions or changes.