feat(Calendar): add Header component

This commit is contained in:
陈嘉涵
2019-12-26 19:59:08 +08:00
committed by neverland
parent f4f8952553
commit 04c412c99b
4 changed files with 94 additions and 61 deletions
+10
View File
@@ -1,3 +1,13 @@
import { createNamespace } from '../utils';
const [createComponent, bem, t] = createNamespace('calendar');
export { createComponent, bem, t };
export function formatMonthTitle(date: Date) {
return t('monthTitle', date.getFullYear(), date.getMonth() + 1);
}
export function compareMonth(date1: Date, date2: Date) {
const year1 = date1.getFullYear();
const year2 = date2.getFullYear();