google / blockly-android

Blockly for Android
Apache License 2.0
672 stars 209 forks source link

Fix Checkstyle DateFormat Locale #702

Closed ChrisCanCompute closed 6 years ago

ChrisCanCompute commented 6 years ago

Almost all callers should use getDateInstance(), getDateTimeInstance(), or getTimeInstance() to get a ready-made instance of SimpleDateFormat suitable for the user's locale. The main reason you'd create an instance this class directly is because you need to format/parse a specific machine-readable format, in which case you almost certainly want to explicitly ask for US to ensure that you get ASCII digits (rather than, say, Arabic digits).

Here, we're parsing to/from a save file, therefore should be using US Locale for storing dates.


This change is Reviewable

AnmAtAnm commented 6 years ago
:lgtm:

Review status: 0 of 1 files reviewed at latest revision, all discussions resolved.


Comments from Reviewable