Day Suffix
Chazzman opened this issue · comments
Might be nice to add a day suffix to the library. Something like:
`extension Date {
static func getSuffix(forDate date: Date) -> String {
if let day = date.component(.day) {
let st: Set = [1, 21, 31]
let nd: Set = [2, 22]
let rd: Set = [3, 23]
if st.contains(day) {
return "st"
}
else if nd.contains(day) {
return "nd"
}
else if rd.contains(day) {
return "rd"
}
else {
return "th"
}
} else {
return ""
}
}
}`
Thanks!
I just added it as a new style format:
now.toString(style: .ordinalDay)
should yield 27th i.e.
Awesome
Thanks
Any idea as to why the pod doesn't seem to work? Update pull 4.1.2 but the changes aren't there. Tried deleting and reinstalling. No errors but not new code either :(
Cocoapods fixed now
Hmmm
Still not pulling
…On May 19, 2017, 2:24 PM -0400, Melvin Rivera ***@***.***>, wrote:
Cocoapods fixed now
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
Ah yes, sorry I fixed the pod lint issue but forgot to push to cocoa pods trunk. It's updated now.
That did the trick!
Thanks again!
…On May 22, 2017, 12:01 PM -0400, Melvin Rivera ***@***.***>, wrote:
Ah yes, sorry I fixed the pod lint issue but forgot to push to cocoa pods trunk. It's updated now.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.