DateHelper

A high performant Swift Date Extension for creating, comparing, or modifying dates.

Capabilities


  • Date from String
    • Using date detection i.e. "Tomorrow at 5:30 PM"
    • With predefined format: i.e. .isoDateTime
    • With custom format: i.e. "dd MMM yyyy HH:mm:ss"
  • String from Date
    • With predefined format: i.e. .rss
    • With custom format: i.e. ""MMM d, yyyy""
    • With combined date and time style: i.e. .medium
    • With individual date and time style: i.e. .medium, .short
  • Modify Date
    • Offset date component: i.e. .offset(.second, value: 110)
    • Adjust date component: i.e. .adjust(hour: 12, minute: 0, second: 0)
    • Adjust date to a predefined time: i.e. .adjust(for: .startOfDay)
  • Compare Date
    • Compare against relative date in predefined format: i.e. .isToday, .isThisWeek
    • Compare againnst target date: i.e. firstDate.compare(.isSameMonth(as: secondDate))
  • Time Since
    • Time since target date in component: i.e. Date().since(secondDate, in: .second)
  • Extras
    • Extract date and time components: i.e. .hour, .minute, .day
    • Conveniance methods: i.e. numberOfDaysInMonth(), firstDayOfWeek(), .lastDayOfWeek()

Date From String


Provides initializers to create a Date from a String

Detect a Date from natural language in a String

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top