Skip to content

Commit c8dece2

Browse files
zangguodongGuodong
and
Guodong
authoredJun 22, 2021
feat: date picker & time picker (#124)
Co-authored-by: Guodong <gdzang@alauda.io>
1 parent e1c92c6 commit c8dece2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3504
-2
lines changed
 

‎package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"ui"
1717
],
1818
"scripts": {
19-
"build": "ng-packagr && yarn build:copy",
19+
"build": "ng-packagr -c tsconfig.lib.json && yarn build:copy",
2020
"build:copy": "node scripts/copy-resources",
2121
"debug": "ng-packagr -p ng-package.debug.json && yarn build:copy --debug",
2222
"dev": "yarn start",
@@ -44,6 +44,7 @@
4444
"@angular/forms": "^10.0.0 || ^11.0.0",
4545
"@angular/platform-browser": "^10.0.0 || ^11.0.0",
4646
"clipboard-polyfill": "^3.0.0",
47+
"dayjs": "^1.0.0",
4748
"rxjs": "^6.0.0"
4849
},
4950
"devDependencies": {
@@ -73,6 +74,7 @@
7374
"@types/node": "^14.14.31",
7475
"@types/resize-observer-browser": "^0.1.5",
7576
"clipboard-polyfill": "^3.0.2",
77+
"dayjs": "^1.10.4",
7678
"gulp": "^4.0.2",
7779
"gulp-dart-sass": "^1.0.2",
7880
"jest": "^26.6.3",

‎src/date-picker/calendar/constant.ts

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { DateNavRange } from '../date-picker.type';
2+
3+
export const DATE = 'date';
4+
export const DAY = 'day';
5+
export const MONTH = 'month';
6+
export const YEAR = 'year';
7+
export const HOUR = 'hour';
8+
export const MINUTE = 'minute';
9+
export const SECOND = 'second';
10+
11+
// 根据日期类型,分为年,月,日
12+
export enum DatePickerType {
13+
Day = 'date',
14+
Month = 'month',
15+
Year = 'year',
16+
}
17+
18+
export const MONTH_PANEL_COLUMN_COUNT = 3;
19+
export const MONTH_PANEL_ROW_COUNT = 4;
20+
21+
export const YEAR_PANEL_COLUMN_COUNT = 3;
22+
export const YEAR_PANEL_ROW_COUNT = 4;
23+
24+
export const DAY_PANEL_COLUMN_COUNT = 7;
25+
export const DAY_PANEL_ROW_COUNT = 6;
26+
27+
export const DATE_TYPES = [
28+
DatePickerType.Year,
29+
DatePickerType.Month,
30+
DatePickerType.Day,
31+
];
32+
33+
export const DATE_NAV_RANGES = [
34+
DateNavRange.Decade,
35+
DateNavRange.Year,
36+
DateNavRange.Month,
37+
];

0 commit comments

Comments
 (0)
Please sign in to comment.