Azure / azure-cosmosdb-java

Java Async SDK for SQL API of Azure Cosmos DB
MIT License
54 stars 61 forks source link

Fix date format for non-english locale #52

Closed fpaparoni closed 6 years ago

moderakh commented 6 years ago

@fpaparoni thanks for the PR.

I wonder if we can have a unit test for this which Utils.nowAsRFC1123() returns the correct value for Non US Locale? Can you please add that too?

fpaparoni commented 6 years ago

Utils.nowAsRFC1123() now always returns a value for Locale.US because otherwise it isn't accepted by cosmosdb, so I don't understand a test for non US Locale.

moderakh commented 6 years ago

I assume on non-english locale in the absence of your PR Utils.nowAsRFC1123() returns invalid type format. am I right?

if so then maybe we can have a unit test which sets the non-english locale in the JVM, gets the value of validate Utils.nowAsRFC1123() time and format, and then set back default locale in the JVM.

This test will pass for your PR, but will fail in the absence of your PR. Does this make sense?

msftclas commented 6 years ago

CLA assistant check
All CLA requirements met.

fpaparoni commented 6 years ago

Ok I understood the purpose of it and I pushed the unit test

moderakh commented 6 years ago

Thank you @fpaparoni merging this PR. This will be in the next release.