Skip to content
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

Merged
merged 2 commits into from
Jan 6, 2018

Conversation

hsuanxyz
Copy link
Member

@hsuanxyz hsuanxyz commented Dec 1, 2017

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[X] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[X] Documentation content changes
[ ] Application (the showcase website) / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: #646 -

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[X] No

Other information

Checklist

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.7%) to 41.047% when pulling c08127b on HsuanXyz:feat-datepacker-range into 68163a4 on NG-ZORRO:master.

@hsuanxyz hsuanxyz changed the title feat(module:datepicker): add range-picker component [WIP]feat(module:datepicker): add range-picker component Dec 7, 2017
@hsuanxyz hsuanxyz force-pushed the feat-datepacker-range branch from c08127b to 268afb6 Compare December 10, 2017 14:54
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.6%) to 40.288% when pulling 268afb6 on HsuanXyz:feat-datepacker-range into 6ff34ec on NG-ZORRO:master.

@hsuanxyz hsuanxyz force-pushed the feat-datepacker-range branch from 268afb6 to c02d918 Compare December 11, 2017 05:58
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.7%) to 40.21% when pulling c02d918 on HsuanXyz:feat-datepacker-range into e9e7751 on NG-ZORRO:master.

@hsuanxyz hsuanxyz force-pushed the feat-datepacker-range branch from c02d918 to d5bad61 Compare December 12, 2017 11:37
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.9%) to 39.96% when pulling 05d6124 on HsuanXyz:feat-datepacker-range into 504fdc8 on NG-ZORRO:master.

@hsuanxyz hsuanxyz force-pushed the feat-datepacker-range branch from 05d6124 to 697d1cb Compare December 19, 2017 11:09
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.9%) to 39.958% when pulling 697d1cb on HsuanXyz:feat-datepacker-range into 6eac0b0 on NG-ZORRO:master.

@hsuanxyz hsuanxyz force-pushed the feat-datepacker-range branch from 697d1cb to 0436b4a Compare December 22, 2017 08:50
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.0%) to 39.895% when pulling 0436b4a on HsuanXyz:feat-datepacker-range into bda29de on NG-ZORRO:master.

@hsuanxyz hsuanxyz force-pushed the feat-datepacker-range branch from 0436b4a to a7be9e7 Compare December 22, 2017 09:35
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.0%) to 39.895% when pulling a7be9e7 on HsuanXyz:feat-datepacker-range into bda29de on NG-ZORRO:master.

@hsuanxyz hsuanxyz force-pushed the feat-datepacker-range branch from a7be9e7 to a6219fd Compare December 22, 2017 10:00
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.0%) to 39.902% when pulling a6219fd on HsuanXyz:feat-datepacker-range into bda29de on NG-ZORRO:master.

@hsuanxyz hsuanxyz changed the title [WIP]feat(module:datepicker): add range-picker component feat(module:datepicker): add range-picker component Dec 22, 2017
@hsuanxyz
Copy link
Member Author

Ready for review

@@ -46,6 +47,8 @@ export interface WeekInterface {
days: DayInterface[];
}

export enum RangePart { Start = 0, End = 1 }
Copy link
Member Author

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>
Copy link
Member Author

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 {
Copy link
Member Author

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
@hsuanxyz hsuanxyz force-pushed the feat-datepacker-range branch from a6219fd to fe401b4 Compare January 6, 2018 06:04
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.9%) to 39.88% when pulling fe401b4 on HsuanXyz:feat-datepacker-range into 2de24ee on NG-ZORRO:master.

@@ -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',
Copy link
Member Author

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!

@vthinkxie vthinkxie merged commit 9df3eb9 into NG-ZORRO:master Jan 6, 2018
@hsuanxyz hsuanxyz deleted the feat-datepacker-range branch May 2, 2018 04:00
hsuanxyz added a commit to hsuanxyz/ng-zorro-antd that referenced this pull request Aug 5, 2020
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants