tanclary commented on code in PR #3761:
URL: https://github.com/apache/calcite/pull/3761#discussion_r1567660915
##########
core/src/main/java/org/apache/calcite/util/format/FormatElementEnum.java:
##########
@@ -217,6 +291,34 @@ public enum FormatElementEnum implements FormatElement {
sb.append(String.format(Locale.ROOT, "%d", (calendar.get(Calendar.MONTH)
/ 3) + 1));
}
},
+ AMPM("", "The time as Meridian Indicator in uppercase") {
+ @Override public void format(StringBuilder sb, Date date) {
+ final Calendar calendar = Work.get().calendar;
+ calendar.setTime(date);
+ sb.append(calendar.get(Calendar.AM_PM) == Calendar.AM ? "AM" : "PM");
Review Comment:
can you just call `.toString()` on calendar.get(am_pm)` or no
##########
core/src/main/java/org/apache/calcite/util/format/FormatElementEnum.java:
##########
@@ -306,12 +446,22 @@ static Work get() {
* https://issues.apache.org/jira/browse/CALCITE-6252. This may be
* specific to Java 11. */
final DateFormat mmmmFormat = new SimpleDateFormat(MONTH.javaFmt,
Locale.US);
- final DateFormat sFormat = new SimpleDateFormat(FF1.javaFmt, Locale.ROOT);
- final DateFormat ssFormat = new SimpleDateFormat(FF2.javaFmt, Locale.ROOT);
final DateFormat sssFormat = new SimpleDateFormat(FF3.javaFmt,
Locale.ROOT);
- final DateFormat ssssFormat = new SimpleDateFormat(FF4.javaFmt,
Locale.ROOT);
- final DateFormat sssssFormat = new SimpleDateFormat(FF5.javaFmt,
Locale.ROOT);
- final DateFormat ssssssFormat = new SimpleDateFormat(FF6.javaFmt,
Locale.ROOT);
final DateFormat yyFormat = new SimpleDateFormat(YY.javaFmt, Locale.ROOT);
+ final DateFormat yyyyFormat = new SimpleDateFormat(YYYY.javaFmt,
Locale.ROOT);
+
+ /** Util to return the full or abbreviated weekday name from date and
expected TextStyle. */
+ public String getDayFromDate(Date date, TextStyle style) {
Review Comment:
should this be private
--
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]