You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need dates formatted the following way:
"yesterday 3:25 AM"
"today 4:00 PM"
"tomorrow 10:00 PM"
"3 days ago 10:00 PM"
I am not sure this is possible with SwiftDate 3.0.2 I am using (though I must admit I might not have understood something, there seem to be so many parameters). Here is what I tried:
date.toString(.ShortStyle, relative: true) is the closest to what I need, but not quite it. I need more control over the resulting string. For instance, I would like to be able to control capitalization, or get rid of comma, or output "yest" instead of "yesterday".
Deprecation note for toRelativeString() method says I should "Use toNaturalString() with relative parameters". However, I can't seem to figure out how to do this. FormatterStyle struct, which is supposed to be used for configuration, does not expose any parameters to configure relative formatting.
Also, there is Issue #79, toComponentsStrings might be of help, but it is not included in 3.0.2.
The text was updated successfully, but these errors were encountered:
I'll close this. Now we have an initial implementation; we can continue here: #168
I've posted specs about the class and the implementation. We can start working on it.
I need dates formatted the following way:
"yesterday 3:25 AM"
"today 4:00 PM"
"tomorrow 10:00 PM"
"3 days ago 10:00 PM"
I am not sure this is possible with SwiftDate 3.0.2 I am using (though I must admit I might not have understood something, there seem to be so many parameters). Here is what I tried:
date.toString(.ShortStyle, relative: true)
is the closest to what I need, but not quite it. I need more control over the resulting string. For instance, I would like to be able to control capitalization, or get rid of comma, or output "yest" instead of "yesterday".Deprecation note for
toRelativeString()
method says I should "Use toNaturalString() with relative parameters". However, I can't seem to figure out how to do this.FormatterStyle
struct, which is supposed to be used for configuration, does not expose any parameters to configure relative formatting.Also, there is Issue #79,
toComponentsStrings
might be of help, but it is not included in 3.0.2.The text was updated successfully, but these errors were encountered: