tanclary commented on code in PR #3611:
URL: https://github.com/apache/calcite/pull/3611#discussion_r1445040089


##########
core/src/main/java/org/apache/calcite/util/format/FormatElementEnum.java:
##########
@@ -41,6 +41,13 @@
  * @see FormatModels#DEFAULT
  */
 public enum FormatElementEnum implements FormatElement {
+  CC("cc", "century (2 digits) (the twenty-first century starts on 
2001-01-01)") {

Review Comment:
   I think the commit message should probably be more descriptive, I wasn't 
sure what `Support date format` meant until I reviewed the PR.



##########
core/src/test/java/org/apache/calcite/util/format/FormatElementEnumTest.java:
##########
@@ -35,6 +35,13 @@ class FormatElementEnumTest {
     assertThat(ts, hasToString("Tuesday"));
   }
 
+  @Test void testday() {

Review Comment:
   Test name should be camelcase



##########
core/src/test/java/org/apache/calcite/util/format/FormatElementEnumTest.java:
##########
@@ -174,4 +188,11 @@ class FormatElementEnumTest {
     FormatElementEnum.YYYY.format(ts, Date.from(Instant.parse(date)));
     assertThat(ts, hasToString("2014"));
   }
+
+  @Test void testCC() {
+    final String date = "2014-09-30T10:00:00Z";

Review Comment:
   Instead of adding to the end of the file why don't we make these alphabetical



##########
core/src/main/java/org/apache/calcite/util/format/FormatElementEnum.java:
##########
@@ -54,6 +61,12 @@ public enum FormatElementEnum implements FormatElement {
       sb.append(work.eeeeFormat.format(date));
     }
   },
+  day("eeee", "The full lower case day name") {

Review Comment:
   Enum constants should be all uppercase I believe. 
   https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html



##########
core/src/test/java/org/apache/calcite/util/format/FormatElementEnumTest.java:
##########
@@ -63,6 +70,13 @@ class FormatElementEnumTest {
     assertThat(ts, hasToString("Tue"));
   }
 
+  @Test void testdy() {

Review Comment:
   same comment as above



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to