Skip to content

Commit

Permalink
UIFR-220 Format date without timezone conversion (#69)
Browse files Browse the repository at this point in the history
* UIFR-220 Format date without timezone conversion

* UIFR-220 Call method instead of repeat code.
  • Loading branch information
icrc-jfigueiredo authored Sep 22, 2021
1 parent d81c458 commit d0c6a38
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion api/src/main/java/org/openmrs/ui/framework/UiUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,18 @@ public String formatDatePretty(Date date) {
return format(dateExt.getDateWithoutTime());
}
}


/**
* Formats a date without any timezone conversion
*
* @param date the date to format
* @return date formatted
*/
public String formatDateWithoutTimezoneConversion(Date date) {
SimpleDateFormat dateFormat = new SimpleDateFormat(getDateFormat(), Context.getLocale());
return dateFormat.format(date);
}

/**
* Formats a date with this format: dd MMM yyyy hh:mm a
*
Expand Down

0 comments on commit d0c6a38

Please sign in to comment.