-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add singular form for verbose time description #10
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patch itself looks good to me!
What I’m wondering about - didn’t newer versions of macOS / iOS introduce convenience code to print such user visible strings in all locales? Can we use that?
awesome!!! This is exactly the reason why we need the Testsuite. To find all those tiny bugs and fix them along the way and make sure that this doesn't break in the future 🙌 |
@fkuehne I think you might be talking about using the Date components Api. We should definitely switch to that here and not try to reimplement the logic. https://developer.apple.com/documentation/foundation/datecomponents |
Yes, that’s exactly the API I had in mind. Since we will require macOS 10.10 for VLCKit 4, it will be a good idea to switch to it.
|
One question! When you have 1:00:30, do we want this to be "1 hour 30 seconds" or just "1 hour"? |
I would prefer “1 hour 30 seconds” to be as precise as possible. Custom strings can be created easily by the client app if desired.
|
I also noticed "1 hour 20 minutes 30 seconds" is represented as "1 hour 20 minutes". Is this desired behavior? |
Why don't you take a look at what the nsdateformatter will give you by default? The rest just comes down to personal preference ¯_(ツ)_/¯ and like felix says if someone wants something else they can easily adapt it |
Ok cool. I'll go with the default format. I was just wondering cause I thought there was some particular reason behind things :D |
ffc8f72
to
7963975
Compare
Sources/VLCTime.m
Outdated
- (void)initDateComponents | ||
{ | ||
if (!components) | ||
components = [[NSDateComponents alloc] init]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
turns out I've been mixing up the expensiveness of NSDateFormatter with NSDateComponents.
You can use this one actually directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the rest looks good. I would add a couple of examples in the description and update the News to note that we adjusted this method . As reference for the description I would point to - (NSString *)stringFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate; and I think this can be merged then
b939944
to
2a7651e
Compare
2a7651e
to
b73762a
Compare
I just tested it and it works great but the localization for remaining doesn't work. I will merge it anyway because it's improvement. |
this was merged |
When using
VLCTime.verboseDescription
,1 minutes 20 seconds is now 1 minute 20 seconds