need to format date in QQ-YYYY (Quarter of year format). Ex: if date is Jan 2, 2021, then it should display as 01-2021

0 Answers 228 Views
Grid Sortable
Sunitha
Top achievements
Rank 1
Sunitha asked on 02 Aug 2022, 04:57 PM

Hi,

I have a kendo grid for MVC and bound columns. I have to format date in one of columns as specified above.(QQ-YYYY)(Quarter Of the year format.) I tried below for followup date, but doesnt work. Please let me know solution that works other than this

 

@(Html.Kendo().Grid(Model) .Name("grid") .Columns(columns => { columns.Bound(p => p.TeamRank).Title("Team Rank").Hidden(); columns.Bound(p => p.ETA).Title("Forecast").ClientTemplate("#=formatDate(ETA)#"); }

function formatDate(ETA) {
    var CurrentQuarter = ((ETA.getMonth - 1) / 3) + 1;
    return CurrentQuarter + "-" + ETA.getFullYear;
}

No answers yet. Maybe you can help?

Tags
Grid Sortable
Asked by
Sunitha
Top achievements
Rank 1
Share this question
or