Swiftpack.co - kraigspear/SpearDates as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by kraigspear.
kraigspear/SpearDates 1.1.3
Date Utilities
⭐️ 0
🕓 25 weeks ago
iOS macOS
.package(url: "https://github.com/kraigspear/SpearDates.git", from: "1.1.3")


SpearDates contains date convience routies reducing common that can be repeated in a projects.


In order to get the Month, Day and Year of a date we need to

  1. Create the flags for Month/Day/Year
  2. Get those components from a calendar
  3. Extract each element, checking for nil

This code can be simplifed to

let currentYear = Date().toMondthDayYear().year



Stars: 0
Last commit: 2 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Date using percentage
25 weeks ago

A date can be created by using the percentage of time passed in a day.

Example 0.5 would be 12pm

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics