Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
417 views
in Technique[技术] by (71.8m points)

date - Kendo Angular Parse month number to month name

how can i display month names without converting each month number via a function

this is my kendo grid with month column:

<kendo-grid-column field="month">
        <ng-template kendoGridCellTemplate let-dataItem="dataItem">
                <span>{{convertMonthNToName(dataItem)}}</span>
        </ng-template>
</kendo-grid-column>

the function convertMonthNToName contains a switch that returns a string month name

Is there anything kendo preset that does this? via a parse or via culture libraries


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If perceived well, please use DatePipe and try the following:

<kendo-grid-column field="month">
     <ng-template kendoGridCellTemplate let-dataItem="dataItem">
             <span>{{dataItem | date: 'MMMM'}}</span>
     </ng-template>
</kendo-grid-column>

Please provide some stackblitz demo to make it more specific.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...