# Displaying Empty Cell When Min Date

## Environment

<table>
	<tr>
		<td>Product Version</td>
		<td>2022.3.1109</td>
	</tr>
	<tr>
		<td>Product</td>
		<td>Telerik UI for ASP.NET Core Grid</td>
	</tr>
</table>

## Description

How can I display an empty string when the field value is the minimum Date value?

## Solution

1. Use a ClientTemplate for the pointed column.
2. Call a JavaScript function in the ClientTemplate and pass the current [dataItem](https://docs.telerik.com/kendo-ui/api/ui/grid/methods/dataitem) as a parameter.
3. In the function handler, initialize a custom variable with value the min one for the Date type.
4. Add one day to the custom variable from point 3 to handle all the timezone transformations.
5. Conditionally check if the date field of the dataItem has value less than the value of the custom variable.
6. If the condition is results in true - return an empty string.
7. Else - return the date value in the proper format.
8. Here is an example:

```Razor Index.cshtml
columns.Bound(p => p.OrderDate).ClientTemplate("#=orderDetails(data)#");
```

```JavaScript
<script>
    function orderDetails(order) {

        var minDate = new Date('0001-01-01T00:00:00Z');
        minDate.setDate(minDate.getDate() + 1);

        if (order.OrderDate < minDate) {
            return "";
        }
        else {
            return kendo.toString(order.OrderDate, "g");
        }
    }
</script>
```

## More ASP.NET Core Grid Resources

* [ASP.NET Core Grid Documentation](https://www.telerik.com/aspnet-core-ui/documentation/html-helpers/data-management/grid/overview)

* [ASP.NET Core Grid Demos](https://demos.telerik.com/aspnet-core/grid/index)

* [ASP.NET Core DataGrid Product Page](https://www.telerik.com/aspnet-core-ui/grid)

* [Telerik UI for ASP.NET Core Video Onboarding Course (Free for trial users and license holders)](https://www.telerik.com/aspnet-core-ui/documentation/getting-started/video-onboarding)

* [Telerik UI for ASP.NET Core Forums](https://www.telerik.com/forums/aspnet-core-ui)

## See Also

* [Client-Side API Reference of the Grid for ASP.NET Core](https://docs.telerik.com/kendo-ui/api/ui/grid)
* [Server-Side API Reference of the Grid for ASP.NET Core](https://docs.telerik.com/aspnet-core/api/grid)
* [Telerik UI for ASP.NET Core Breaking Changes](https://www.telerik.com/aspnet-core-ui/documentation/backwards-compatibility/2023-backwards-compatibility)
* [Telerik UI for ASP.NET Core Knowledge Base](https://docs.telerik.com/aspnet-core/knowledge-base)
