-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(module:datepicker): add range-picker component #656
Conversation
c08127b
to
268afb6
Compare
268afb6
to
c02d918
Compare
c02d918
to
d5bad61
Compare
05d6124
to
697d1cb
Compare
697d1cb
to
0436b4a
Compare
0436b4a
to
a7be9e7
Compare
a7be9e7
to
a6219fd
Compare
Ready for review |
@@ -46,6 +47,8 @@ export interface WeekInterface { | |||
days: DayInterface[]; | |||
} | |||
|
|||
export enum RangePart { Start = 0, End = 1 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使用 enum 代替数组下标来表示开始和结束。
<div class="ant-calendar-date-panel"> | ||
<ng-container *ngTemplateOutlet="calendarRangePart; context: { part: _part.Start }"></ng-container> | ||
<span class="ant-calendar-range-middle">~</span> | ||
<ng-container *ngTemplateOutlet="calendarRangePart; context: { part: _part.End }"></ng-container> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里用 ng-container
创建了日历的两个部分,在它们内部使用 part
变量区分。
this._disabledDatePart[RangePart.End] = this._mode[RangePart.End] === 'month' ? null : this._disabledDate; | ||
} | ||
|
||
_generateYearPanel(): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个方法与 nz-datepicker
组件代码一样,可以考虑写公共部分。
feat(module:datepicker): support [nzShowTime] feat(module:datepicker): hover to highlight the range feat(module:datepicker): support input export component
a6219fd
to
fe401b4
Compare
@@ -34,6 +34,8 @@ export const trTR: NzLocale = { | |||
chooseDate: 'Tarih seçin', | |||
chooseTimePlease: 'Saat seçin', | |||
chooseDatePlease: 'Tarih seçin', | |||
chooseStartDatePlease: 'Başlangıç tarihi', | |||
chooseEndDatePlease: 'Bitiş tarihi', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zverbeta please review this translation, thanks!
* feat(module:datepicker): add range-picker component feat(module:datepicker): support [nzShowTime] feat(module:datepicker): hover to highlight the range feat(module:datepicker): support input export component * feat(module:locale): add russian locale for the date range component
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #646 -
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Checklist
nzSize
nzFormat
nzDisabled
nzDisabledDate
nzShowTime