akosma / SwiftMoment

A time and calendar manipulation library for iOS 9+, macOS 10.11+, tvOS 9+, watchOS 2+ written in Swift 4.
http://akosma.github.io/SwiftMoment
BSD 2-Clause "Simplified" License
1.61k stars 147 forks source link

`fromNow()` not returning localized string #87

Open samwize opened 7 years ago

samwize commented 7 years ago

Detailed Description

Using fromNow() did not return the localized version for "%d days ago" and others.

The string format used in fromNow() is %%1.0f %@days ago, but in the strings files all uses %d and not %f, therefore it never get matched.

Context

Seems like a broken change.

Possible Implementation

Change the format to %d days ago, and use value as Int.

Your Environment

samwize commented 7 years ago

In master this is working correctly using %d. Please merge so that the current pod version 0.7 can work.