https://github.com/hughbe/date-previous
A library that lets you get the previous day of week from a given date.
https://github.com/hughbe/date-previous
Last synced: 3 months ago
JSON representation
A library that lets you get the previous day of week from a given date.
- Host: GitHub
- URL: https://github.com/hughbe/date-previous
- Owner: hughbe
- License: mit
- Created: 2018-02-16T13:44:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-16T13:45:42.000Z (over 7 years ago)
- Last Synced: 2025-02-08T07:02:41.939Z (4 months ago)
- Language: Swift
- Size: 5.86 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Date+Previous
A library that lets you get the previous day of week from a given date.
[](https://travis-ci.org/hughbe/Date-Previous)
[](http://cocoapods.org/pods/Date+Previous)
[](http://cocoapods.org/pods/Date+Previous)
[](http://cocoapods.org/pods/Date+Previous)## Usage
```swift
import Date_Previouslet date = Date() // E.g 2018-02-13
let previousMonday = date.previous(dayOfWeek: DayOfWeek.Monday) // E.g. 2018-02-12
```## Installation
Date+Previous is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'Date+Previous'
```