如何将JAN添加到Kendo DatePicker(Angular2)弹出左侧导航,它当前显示年份然后FEB

问题描述 投票:1回答:1

当我在左侧导航栏中打开带有月份选择器的DatePicker时,没有1月选项,您必须选择代表JAN的年份;这让我的用户感到困惑。我希望看到我向下滚动的那一年,看到2020年以后的一个JAN,2021等等。

kendo-ui-angular2
1个回答
0
投票

您可以使用kendoCalendarNavigationItemTemplate模板自定义导航条目的显示方式。

这是一个简单的例子,在年份编号后添加“Jan”:

@Component({
    selector: 'my-app',
    styles: ['/deep/ .k-calendar-navigation .k-content li { padding: 0; }'],
    template: `
        <kendo-calendar>
            <ng-template kendoCalendarNavigationItemTemplate let-title>
                {{isNaN(title) ? title : title + " Jan"}}
            </ng-template>
        </kendo-calendar>
    `
})
class AppComponent {
    public isNaN = isNaN;
}

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.