Post

Replies

Boosts

Views

Activity

Comment on Duplicating 24-hour format issue in simulator
"That would have been a useful factoid to include in your question, eh?" Sure. I did mention it was for automated testing, whose purpose is largely to catch errors made by developers. Why they didn't just use date components in this instance (they did later in the same code) is a mystery to me. :) Thanks for the links. I'll review them when I get some time.
Jul ’21
Comment on Duplicating 24-hour format issue in simulator
Reference for DateFormatter says, "func date(from: String) -> Date? Returns a date representation of a specified string that the system interprets using the receiver’s current settings." So it seems like I should be able to set it some way to duplicate the behavior. For unit tests, we'd probably want to loop through a bunch of settings. I'm looking for some settings that duplicate the behavior, above.
Jul ’21
Comment on Duplicating 24-hour format issue in simulator
That does not answer the question. I know it's wrong, and I've pointed it out to the development team who coded it. What I'm looking for is a way to get the simulator to behave like a device in order to be able to trap such things with unit tests. Maybe there's some other code somewhere in the app that has a similar issue. It won't be caught by unit tests running on a simulator unless we can somehow set the simulator to behave the same way. The docs say that it uses the locale setting, so maybe there's a way to set the locale to mimic what I described in my original post. What I've tried doesn't work, though.
Jul ’21