Find file History
thechriskent Expression updates (#78)
* Updated number-quiz-smiley to use Excel-style expression

* Updated text-isbn-image to use Excel-style expression

* Updated text-wrap-format schema

* Updated generic-staticmap to use Excel-style expressions

* Updated generic-svgicon-format to use Excel-style expressions

* Updated generic-hyperlink-values to use Excel-style expressions

* Updated generic-hyperlink-thumbnail to use Excel-style expressions

* Updated number-conditional-format to use Excel-style expressions

* Updated number-piechart to use Excel-style expressions and theme classes

* Updated picture-roundimage-format schema

* Updated text-conditional-format to use Excel-style expressions, theme color, and fixed an issue

* Updated yesno-checkmark to use Excel-style expressions

* Updated yesno-checkmark-format to use Excel-style expressions

* Updated person-roundimage-format to use Excel-style expressions

* Updated text-ryg-status-indicator to use Excel-style expressions and theme classes

* Updated date-range-rag to use Excel-style expressions, theme colors, and simplified calculations

* Updated currecy-symbol-concatenation to use Excel-style expressions

* Updated generic-project-management to use Excel-style expressions and theme color classes

* Updated number-trending-icon to use Excel-style expressions

* Additional cleanup
Latest commit f3d1f28 Aug 21, 2018
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
README.md Expression updates (#78) Aug 21, 2018
date-range-format.json Expressions (#75) Aug 18, 2018
date-range-formatAST.json Expressions (#75) Aug 18, 2018
screenshot.png Updating structures ready for upcoming row formatting samples Jun 7, 2018

README.md

Formatting an item when a date column is before or after today's date

Summary

This example colors the current field red when the value inside an item's DueDate is before the current date/time. Unlike some of the previous examples, this example applies formatting to one field by looking at the value inside another field. Note that DueDate is referenced using the [$FieldName] syntax. FieldName is assumed to be the internal name of the field. This example also takes advantage of a special value that can be used in date/time fields - @now, which resolves to the current date/time, evaluated when the user loads the list view.

screenshot of the sample

Although the color can be specified directly in a style property, the UI Fabric ms-fontColor-redDark class is used to ensure the color matches the defined Office styles.

View requirements

  • This format can be applied to any column type
  • An additional DateTime column with an internal name of DueDate

Sample

Solution Author(s)
date-range-format.json SharePoint Team

Version history

Version Date Comments
1.0 November 2, 2017 Initial release
1.1 March 22, 2018 Minor color adjustment
1.2 August 17, 2018 Changed color from style to class and switched to Excel-style expressions

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.


Additional notes

This sample is also covered in the main documentation around Column Formatting

An additional version using Abstract Tree Syntax (AST) is also provided for environments where the Excel-style expressions are not supported.