Skip to content

Instantly share code, notes, and snippets.

@jonahadkins
Last active March 17, 2023 04:27
Show Gist options
  • Save jonahadkins/9dc7310444b811ad5ae484cdb48c23be to your computer and use it in GitHub Desktop.
Save jonahadkins/9dc7310444b811ad5ae484cdb48c23be to your computer and use it in GitHub Desktop.

Esri Arcade Labeling Expression

When today's date is 12/24/36 months from attribute date, label the date with green/yellow/red.

when (
(DateDiff(Today(), $feature.date, 'months') <= 12),
'<CLR green = "255">' + TEXT($feature.date, 'D MMM YYYY') +'</CLR>',
(DateDiff(Today(), $feature.date, 'months') <= 24) ,
'<CLR yellow = "255">' + TEXT($feature.date, 'D MMM YYYY') +'</CLR>',
(DateDiff(Today(), $feature.date, 'months') >= 36) ,
'<CLR red = "255">' + TEXT($feature.date, 'D MMM YYYY') +'</CLR>',
'NO')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment