Skip to content

1.3.0

Choose a tag to compare

@prachigauriar prachigauriar released this 03 Oct 00:33
· 5 commits to main since this release

Adds functions for randomly generating dates within a specified range.

  • Date has been extended with two static functions, both spelled random(in:using:), that generate a random date in either a closed or half-open range.
  • RandomValueGenerating has been extended with a new property requirement and two new functions.
    • The new property is a ClosedRange<Date> spelled defaultClosedDateRange. This property provides a default closed date range to use when generating random dates. A default implementation is provided.
    • The two new functions, both spelled randomDate(in:), generate a random date in either a closed or half-open range using the aforementioned Date extension. The closed range version’s range parameter is optional. When nil is used (the default), defaultClosedDateRange is used.