danielales2541 commented on code in PR #4510:
URL: https://github.com/apache/fineract/pull/4510#discussion_r2029268182
##########
fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/helper/DateSerializer.java:
##########
@@ -25,17 +25,33 @@
import java.lang.reflect.Type;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
+import java.util.Locale;
public class DateSerializer implements JsonSerializer<LocalDate> {
private final String dateFormat;
+ private String localeCode;
+
+ public DateSerializer(String dateFormat, String localeCode) {
+ this.dateFormat = dateFormat;
+ this.localeCode = (localeCode == null ? "" : localeCode);
+ }
public DateSerializer(String dateFormat) {
this.dateFormat = dateFormat;
}
@Override
public JsonElement serialize(LocalDate src, Type typeOfSrc,
JsonSerializationContext context) {
- return new
JsonPrimitive(src.format(DateTimeFormatter.ofPattern(dateFormat)));
+ DateTimeFormatter formatter;
+
+ if (!"".equals(localeCode) && !localeCode.isEmpty()) {
Review Comment:
I apply it thanks
--
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]