Countdown Badge
Overview
- Shows the days left until a date as a round colored coin
- Turns green when far off, amber when near, and red when overdue
- Counts down automatically against the current day
- Urgency thresholds are set in the JSON and easy to change
- Makes the items needing attention pop out of a list
- Applied as column-formatting JSON on a date field, so it changes nothing about the underlying data
Common Use Cases
- Deadlines on a task or filing list
- Renewal or expiry dates
- SLA or response-due dates
- Contract or license end dates
- Event or launch dates
- Any date where the days remaining drive action
Details
- Design Pattern: Dates & Time
- Format Scope: Column
Required Columns
| Display name | Column type | Internal name |
|---|---|---|
| Item | Single line of text | [Title] |
| Due | Date and time | [Due] |
Prerequisites
- Build a list with these columns before you paste the JSON.
- Then populate the list with dates.
- Because the JSON is applied at the column level, the Due column can use any name you want.
- The near and overdue thresholds live in the JSON – change them to match how your team reads urgency.
- It shows four separate states – overdue, 0 to 7 days, 8 to 30 days, and more than 30 days – and because it reads a date the result depends on your tenant time zone and time of day (test close to midnight).
How to Apply JSON code
- On the Due column, open the column header menu, choose Column settings, then Format this column.
- Switch to Advanced mode.
- Paste the JSON below and click Save.
JSON Code
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"style": {
"width": "100%",
"display": "flex",
"justify-content": "center",
"align-items": "center",
"padding-top": "4px",
"padding-bottom": "4px",
"box-sizing": "border-box"
},
"children": [
{
"elmType": "div",
"style": {
"width": "40px",
"min-width": "40px",
"max-width": "40px",
"height": "40px",
"min-height": "40px",
"max-height": "40px",
"border-radius": "50%",
"display": "flex",
"align-items": "center",
"justify-content": "center",
"text-align": "center",
"box-sizing": "border-box",
"font-size": "13px",
"font-weight": "800",
"color": "#ffffff",
"background-color": "=if(@currentField == '', '#b8b8b8', if(((Number(Date(@currentField)) - Number(@now)) / 86400000) < 0, '#d92d20', if(((Number(Date(@currentField)) - Number(@now)) / 86400000) <= 7, '#f79009', if(((Number(Date(@currentField)) - Number(@now)) / 86400000) <= 30, '#12a866', '#067647'))))"
},
"txtContent": "=if(@currentField == '', '-', if(((Number(Date(@currentField)) - Number(@now)) / 86400000) < 0, if(indexOf(((abs(((Number(Date(@currentField)) - Number(@now)) / 86400000))) + ''), '.') < 0, ((abs(((Number(Date(@currentField)) - Number(@now)) / 86400000))) + ''), substring(((abs(((Number(Date(@currentField)) - Number(@now)) / 86400000))) + ''), 0, indexOf(((abs(((Number(Date(@currentField)) - Number(@now)) / 86400000))) + ''), '.'))) + 'd', if(indexOf(((abs(((Number(Date(@currentField)) - Number(@now)) / 86400000))) + ''), '.') < 0, ((abs(((Number(Date(@currentField)) - Number(@now)) / 86400000))) + ''), substring(((abs(((Number(Date(@currentField)) - Number(@now)) / 86400000))) + ''), 0, indexOf(((abs(((Number(Date(@currentField)) - Number(@now)) / 86400000))) + ''), '.'))) + 'd'))"
}
]
}
Common Questions About the Countdown Badge
What is the Countdown Badge built with?
It is built with a standard Microsoft List (SharePoint list) and a small piece of column-formatting JSON. There is no custom development, no SPFx solution, and no third-party tools. It is the kind of clean, maintainable formatting Greg Zelfond builds for teams that want a date column that counts down as a colored coin without ongoing development overhead.
What columns does it need?
It needs one Date column, where the JSON is applied, plus any label column such as the item name. The days remaining and the color are computed from that date against the current day.
Does this design use any custom development or third-party tools?
No. It uses only out-of-the-box SharePoint column formatting, which Microsoft supports natively. That keeps it stable and easy to maintain, and nothing breaks when SharePoint is updated. Out-of-the-box is the only way Greg builds, so you can own and extend the design yourself for years.
If LookBook 365 is code-free and out-of-the-box, why does this example include JSON?
Because SharePoint formatting JSON is not custom code – it is a native configuration feature built into lists and libraries. It is declarative: it only describes how an existing column looks, and cannot run scripts, reach external services, or change your data. Nothing is deployed and nothing breaks when Microsoft updates SharePoint, and you can edit or remove it anytime. That is why LookBook 365 treats it as out-of-the-box and low risk.
Can I change when it turns amber or red?
Yes. The urgency thresholds are day counts in the JSON, set here so the coin turns amber within a week and red once overdue. Adjust them to match your own deadlines.
Can Greg build a design like this for our lists?
Yes – this is exactly the kind of work Greg Zelfond does. As an independent SharePoint consultant and Microsoft MVP, he designs out-of-the-box list and library formatting like this so your team can read and maintain it without a developer. Reach out through the contact page to talk about your lists.
