feat(Calendar): support select day

This commit is contained in:
陈嘉涵
2019-12-26 19:59:08 +08:00
committed by neverland
parent e21455f856
commit 43a0aed8c9
3 changed files with 68 additions and 15 deletions
+2 -1
View File
@@ -1,11 +1,12 @@
import { createNamespace } from '../utils';
import { padZero } from '../utils/format/string';
const [createComponent, bem, t] = createNamespace('calendar');
export { createComponent, bem, t };
export function formatMonthTitle(date: Date) {
return t('monthTitle', date.getFullYear(), date.getMonth() + 1);
return t('monthTitle', date.getFullYear(), padZero(date.getMonth() + 1));
}
export function compareMonth(date1: Date, date2: Date) {