Skip to main content

Add a Date Column

Add a column with type set to date in your risksheet.json:
{
  "columns": [
    {
      "id": "dueDate",
      "header": "Due Date",
      "binding": "dueDate",
      "type": "date"
    }
  ]
}
Risksheet automatically converts values from the Polarion storage format to ISO YYYY-MM-DD strings for display and editing. Date columns parse values in local time to avoid timezone offset problems that can shift dates by one day.

Date Column Types

Risksheet supports three temporal column types, each handling a different precision level:
TypeStoresInternal FormatDisplay ExamplePolarion Field Type
dateDate onlyYYYY-MM-DD2025-03-15DateOnly, Date, Calendar, String
datetimeDate and timeISO datetime2025-03-15T14:30:00Date, Calendar, String
timeTime onlyHH:mm:ss14:30:00TimeOnly, String
The type system supports automatic conversion between Polarion’s internal storage formats and the display format. You can display any Polarion field as a date column regardless of its underlying storage type, as long as the field contains date-compatible values. diagram

Customize the Display Format

Use the format property on the column definition to control how dates appear in the grid:
{
  "id": "dueDate",
  "header": "Due Date",
  "binding": "dueDate",
  "type": "date",
  "format": "dd/MM/yyyy"
}
Common format patterns:
PatternOutputDescription
yyyy-MM-dd2025-03-15ISO date (default for date type)
dd/MM/yyyy15/03/2025European day-month-year format
MM/dd/yyyy03/15/2025US month-day-year format
dd MMM yyyy15 Mar 2025Short month name format
d MMMM yyyy15 March 2025Full month name format
yyyy-MM-dd HH:mm2025-03-15 14:30Date with time (for datetime)
HH:mm:ss14:30:00Time only (for time)
The format string uses the locale-aware formatting library configured by the global.culture setting in risksheet.json:
{
  "global": {
    "culture": "en"
  }
}
Changing global.culture affects month names, day names, number separators, and the default date format. For example, setting "culture": "de" displays month names in German (“Marz” instead of “March”) and uses the appropriate locale conventions.
In version 24.5.0, adding a format property to date-only columns (type: "date") caused save errors due to a timezone fix regression. If you encounter save failures when editing date fields:
  1. Remove the format property from the affected date column
  2. Enter dates in YYYY-MM-DD format directly in the cell (do not use the calendar popup)
  3. Update to a later version that includes the fix
This issue does not affect datetime columns. If you must use a custom date format, test thoroughly after upgrading before re-adding the format property.

Configure Date Fields on Upstream Columns

When displaying a date from an upstream linked work item, set both type and readOnly explicitly:
{
  "id": "reqDueDate",
  "header": "Req. Due Date",
  "binding": "linkedRequirement.dueDate",
  "type": "date",
  "readOnly": false,
  "level": 1
}
Setting readOnly to false enables editing of the upstream linked item’s date field directly from the Risksheet grid, without needing to open the work item in the Polarion editor.
The readOnly property must use an uppercase O: "readOnly": false. Writing "readonly": false (all lowercase) is silently ignored and the column remains read-only. This is the most common configuration mistake when making upstream columns editable. See Enable Editing of Upstream Columns for additional details.
After adding an upstream date column with readOnly: false, reload the risksheet and click the cell. If the date picker does not appear and the cell shows a read-only indicator, double-check the following:
  • The readOnly property uses the exact casing readOnly (capital O)
  • The type property is explicitly set to "date"
  • The current user has write permissions on the upstream work item
  • The grid is not in revision/comparison mode (which forces read-only)

Use Date Fields in Formulas

Date values are accessible in formula expressions as YYYY-MM-DD strings. Because this format orders segments from most significant (year) to least significant (day), simple string comparison produces chronologically correct results:
{
  "formulas": {
    "isOverdue": "function(info){ var due = info.item['dueDate']; if(!due) return ''; var today = new Date().toISOString().split('T')[0]; return due < today ? 'OVERDUE' : 'OK'; }",
    "daysUntilDue": "function(info){ var due = info.item['dueDate']; if(!due) return null; var dueDate = new Date(due + 'T00:00:00'); var today = new Date(); var diff = Math.ceil((dueDate - today) / (1000*60*60*24)); return diff; }"
  },
  "columns": [
    {
      "id": "overdueFlag",
      "header": "Status",
      "formula": "isOverdue"
    },
    {
      "id": "countdown",
      "header": "Days Left",
      "formula": "daysUntilDue",
      "type": "int"
    }
  ]
}
Formula columns that reference date fields are automatically read-only. The formula executes during cell rendering with the {item} context object providing access to all work item properties.
When comparing dates in formulas, always construct Date objects with an explicit time component (e.g., new Date(due + 'T00:00:00')) to avoid timezone-related off-by-one errors. String comparison (due < today) works for simple before/after checks but use Date arithmetic for calculating intervals.

Use Conditional Formatting with Dates

Combine date formulas with cell decorators to visually highlight overdue or approaching deadlines:
{
  "cellDecorators": {
    "dueDateHighlight": "function(info){ var due = info.item['dueDate']; if(!due) return; var today = new Date().toISOString().split('T')[0]; $(info.cell).toggleClass('overdue', due < today); $(info.cell).toggleClass('due-soon', due >= today && due <= new Date(Date.now() + 7*86400000).toISOString().split('T')[0]); }"
  }
}
Then reference the decorator in the column definition using the cellRenderer property. This applies CSS classes (overdue, due-soon) that you can style with custom CSS to show red or yellow backgrounds.

System Date Fields

Certain system date fields are always read-only regardless of column configuration:
FieldDescriptionAuto Read-Only
createdWork item creation timestampYes
updatedLast modification timestampYes
idWork item identifierYes
statusWorkflow statusYes
typeWork item typeYes
projectProject identifierYes
outlineNumberDocument outline numberYes
authorWork item creatorYes
resolutionResolution valueYes
These fields cannot be edited through the Risksheet grid even with readOnly: false. Save attempts to protected fields are silently ignored by the server.

Complete Example

Here is a full configuration snippet showing date columns with formatting, upstream binding, and a formula-driven overdue indicator:
{
  "global": {
    "culture": "en"
  },
  "formulas": {
    "isOverdue": "function(info){ var due = info.item['dueDate']; if(!due) return ''; var today = new Date().toISOString().split('T')[0]; return due < today ? 'OVERDUE' : 'OK'; }"
  },
  "columns": [
    {
      "id": "dueDate",
      "header": "Due Date",
      "binding": "dueDate",
      "type": "date",
      "format": "dd MMM yyyy",
      "level": 1
    },
    {
      "id": "completedDate",
      "header": "Completed",
      "binding": "completedDate",
      "type": "date",
      "level": 1
    },
    {
      "id": "reqDueDate",
      "header": "Req. Due Date",
      "binding": "linkedRequirement.dueDate",
      "type": "date",
      "readOnly": false,
      "format": "dd/MM/yyyy",
      "level": 1
    },
    {
      "id": "overdueFlag",
      "header": "Overdue?",
      "formula": "isOverdue",
      "level": 1
    },
    {
      "id": "createdDate",
      "header": "Created",
      "binding": "created",
      "type": "datetime",
      "format": "yyyy-MM-dd HH:mm",
      "readOnly": true,
      "level": 1
    }
  ]
}

Troubleshooting

Date displays in wrong format — Verify the format property uses the correct pattern syntax (case-sensitive: MM for month, mm for minutes). Check that global.culture matches your expected locale. Date field shows wrong date (off by one day) — This occurs due to timezone conversion when using datetime type for date-only fields. Set the column type to date (not datetime) for date-only values. The date type parses values in local time specifically to prevent this problem. Upstream date column is not editable — Check that readOnly uses uppercase O (readOnly, not readonly). Verify the type property is explicitly set to "date". Confirm the user has write permissions on the upstream work item and the grid is not viewing a historical revision. Save error when editing date column (v24.5.0) — Remove the format property from date-only columns as a workaround. Enter dates in YYYY-MM-DD format directly in the cell. Upgrade to a version newer than 24.5.0 for the permanent fix. Duration fields not displaying correctly — Duration columns use Polarion’s DurationTime format. If you see raw numeric values instead of formatted durations, check that the column type is set to duration and the underlying Polarion field is a DurationTime type.

Verify

After configuring a date column, reload the risksheet page. You should now see the date field displayed in your chosen format. Click the cell to confirm that the date picker appears and editing works correctly. For upstream columns, verify that changes save without error by entering a date and pressing Ctrl+S.

See Also

KB ArticlesSupport TicketsSource Code
  • CellPreviewFormatter.ts
  • GetSetUtil.java
  • PolarionAppConfigManager.java
  • ResetColumnsCommand.ts
  • ConfigureColumnsCommand.ts