Example usage for java.time.chrono Chronology ofLocale

List of usage examples for java.time.chrono Chronology ofLocale

Introduction

In this page you can find the example usage for java.time.chrono Chronology ofLocale.

Prototype

static Chronology ofLocale(Locale locale) 

Source Link

Document

Obtains an instance of Chronology from a locale.

Usage

From source file:org.openlmis.fulfillment.web.util.StatusChangeDto.java

/**
 * Print createdDate for display purposes.
 * @return created date/*from w  w  w . ja v a  2 s.co  m*/
 */
@JsonIgnore
public String printDate() {
    Locale locale = LocaleContextHolder.getLocale();
    String datePattern = DateTimeFormatterBuilder.getLocalizedDateTimePattern(FormatStyle.MEDIUM,
            FormatStyle.MEDIUM, Chronology.ofLocale(locale), locale);
    DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(datePattern);

    return dateTimeFormatter.format(createdDate);
}