Support and Documentation

Date formats and resource bundles

Note

This section describes using resource bundles to customize the front end. For information about using resource bundles to customize Brightspot's widgets, dashboard, reports, and other editorial components, see Customizing Brightspot's labels.

Brightspot displays dates with a default Java format of MMMM d, yyyy hh:mm aa, such as September 8, 2017 02:38 PM.

You can customize the date format by site, theme, content type, and language. For example, you can specify a 12-hour format for general-interest articles, and a 24-hour format for defense-related articles.

Priority of date formats

When resolving the date format to apply, Brightspot checks the following hierarchy and uses the first one available.

  1. Use a format configured in theme's properties (see below).

  2. Use a format configured in a site's settings (see Configuring a site's date format).

  3. Use a format appearing in a view model (see Formatting dates using view models).

  4. Use MMMM d, yyyy hh:mm aa.

Configuring date formats with a resource bundle
  1. Change to or create the path /themes/<theme_name>/resources/brightspot/view/core/.

  2. Change to or create the subdirectory corresponding to the required View for the content type. For example, if you are configuring the date format for the articles' View, change to the subdirectory article.

  3. Create or open the file <View>Override.properties or <View>Override_<language-code>.properties. Examples:

    • The file ArticlePageViewOverride.properties specifies the date format for Views associated with articles.

    • The file ArticlePageViewOverride_fr.properties specifies the date format for Views associated with articles displayed in French.

    • For a list of two-letter language codes, see Codes for the Representation of Names of Languages.

  4. In the properties file, add a line of the form dateFormat=<format-string>.

  5. Reload or rebuild your Brightspot project.