# 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 MVC 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 MVC Grid Resources

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

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

* [ASP.NET MVC Grid Product Page](https://www.telerik.com/aspnet-mvc/grid)

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

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

## See Also

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