format

The format object can be used with numerical or date fields to provide more detail about how values should be displayed in web map pop-up windows. For more information, see fieldInfo and popupInfo.

Properties

Property

Details

dateFormat

A string used with date fields to specify how the date should appear in pop-up windows. Acceptable values are as follows:

  • shortDate—12/21/1997
  • longMonthDayYear—December 21, 1997
  • dayShortMonthYear—21 Dec 1997
  • longDate—Sunday, December 21, 1997
  • shortDateShortTime—12/21/1997 6:00 PM
  • shortDateShortTime24—12/21/1997 18:00
  • longMonthYear—December 1997
  • year—1997

digitsSeparator

A Boolean used with numerical fields. A value of true allows the number to have a digit (or thousands) separator when the value appears in pop-up windows. Depending on the locale, this separator is a decimal point or a comma. A value of false means that no separator will be used.

places

An integer used with numerical fields to specify the number of supported decimal places that should appear in pop-up windows. Any places beyond this value are rounded.

Example

This example shows several instances of a format object defining how numbers and dates should appear in pop-up windows. ACRES is a numerical field, while START is a date field.

"fieldInfos": [
        {. . .},
        {
          "fieldName": "ACRES",
          "label": "Acres burned",
          "isEditable": true,
          "tooltip": "Number of acres burned",
          "visible": true,
          "format": {
            "places": 1,
            "digitSeparator": true
          },
          "stringFieldOption": "textbox"
        },
        {
          "fieldName": "START",
          "label": "Start date",
          "isEditable": true,
          "tooltip": "Fire start date",
          "visible": true,
          "format": {"dateFormat": "dayShortMonthYear"},
          "stringFieldOption": "textbox"
        },
        {. . .}
      ]
12/11/2012