Class Formats.DateFormatter

    • Constructor Detail

      • DateFormatter

        public DateFormatter​(MessagesApi messagesApi)
        Creates a date formatter. The value defined for the message file key "formats.date" will be used as the default pattern.
        Parameters:
        messagesApi - messages to look up the pattern
      • DateFormatter

        public DateFormatter​(MessagesApi messagesApi,
                             String pattern)
        Creates a date formatter.
        Parameters:
        messagesApi - messages to look up the pattern
        pattern - date pattern, as specified for SimpleDateFormat. Can be a message file key.
      • DateFormatter

        public DateFormatter​(MessagesApi messagesApi,
                             String pattern,
                             String patternNoApp)
        Creates a date formatter.
        Parameters:
        messagesApi - messages to look up the pattern
        pattern - date pattern, as specified for SimpleDateFormat. Can be a message file key.
        patternNoApp - date pattern to use as fallback when no app is started.
    • Method Detail

      • print

        public String print​(Date value,
                            Locale locale)
        Unbinds this fields - converts a concrete value to a plain string.
        Specified by:
        print in class Formatters.SimpleFormatter<Date>
        Parameters:
        value - the value to unbind
        locale - the current Locale
        Returns:
        printable version of the value