ng-zorro-antd icon indicating copy to clipboard operation
ng-zorro-antd copied to clipboard

feat(module:datepicker): date-adapter support for other calendars

Open moein459 opened this issue 2 years ago • 21 comments

PR Checklist

Please check if your PR fulfills the following requirements:

  • [ ] The commit message follows our guidelines: https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/CONTRIBUTING.md#commit
  • [x] Tests for the changes have been added (for bug fixes / features)
  • [x] Docs have been added / updated (for bug fixes / features)

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: #6270

What is the new behavior?

CandyDate utility functions moved to a separate date adapter class which can be provided by its token. now users are able to provide custom date adapters to represent other calendars like Jalali or Hijri and deal with native Date objects differently.

Example

jalali-moment date adapter example jalali-date-picker

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

moein459 avatar May 31 '22 17:05 moein459

This preview will be available after the AzureCI is passed.

zorro-bot[bot] avatar May 31 '22 17:05 zorro-bot[bot]

Codecov Report

Merging #7485 (47d6d5e) into master (40815ad) will increase coverage by 0.05%. The diff coverage is 90.57%.

@@            Coverage Diff             @@
##           master    #7485      +/-   ##
==========================================
+ Coverage   91.58%   91.63%   +0.05%     
==========================================
  Files         496      497       +1     
  Lines       16418    16518     +100     
  Branches     2548     2549       +1     
==========================================
+ Hits        15037    15137     +100     
+ Misses       1057     1056       -1     
- Partials      324      325       +1     
Impacted Files Coverage Δ
...mponents/date-picker/lib/decade-table.component.ts 94.73% <ø> (ø)
components/i18n/nz-i18n.service.ts 87.50% <ø> (ø)
components/i18n/nz-i18n.token.ts 100.00% <ø> (ø)
...omponents/date-picker/lib/abstract-panel-header.ts 95.34% <50.00%> (+0.11%) :arrow_up:
components/date-picker/lib/abstract-table.ts 92.15% <80.00%> (+0.49%) :arrow_up:
...mponents/date-picker/date-range-popup.component.ts 95.18% <83.33%> (+0.02%) :arrow_up:
components/core/time/date-adapter.ts 84.90% <84.90%> (ø)
components/i18n/date-helper.service.ts 92.10% <90.00%> (+1.19%) :arrow_up:
components/core/time/candy-date.ts 94.73% <95.00%> (+8.25%) :arrow_up:
components/calendar/calendar-header.component.ts 100.00% <100.00%> (ø)
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 40815ad...47d6d5e. Read the comment docs.

codecov[bot] avatar May 31 '22 18:05 codecov[bot]

This is very useful. Please apply

ali-memar avatar Jul 14 '22 03:07 ali-memar

+1. This is a heavily needed feature.

behdi avatar Jul 16 '22 05:07 behdi

Please add date adapter support for other calendars to the framework https://github.com/NG-ZORRO/ng-zorro-antd/issues/7567

saeidi-dev avatar Jul 17 '22 07:07 saeidi-dev

+1

mkzaker avatar Jul 27 '22 15:07 mkzaker

Can we hope for this feature to be merged anytime soon?

behdi avatar Sep 28 '22 05:09 behdi

oh, this feature is so good, please merge it ...

MohammadMobasher avatar Oct 01 '22 08:10 MohammadMobasher

+1

saeidi-dev avatar Oct 02 '22 03:10 saeidi-dev

I think this feature is a most-wanted. @wenqi73 seems to be inactive for a while. Consider to reassign the code review? cc @simplejason

wzhudev avatar Oct 26 '22 11:10 wzhudev

@wenqi73 @simplejason This useful feature should have been added to the framework a long time ago. This is also available in the ng-bootstrap framework. https://ng-bootstrap.github.io/#/components/datepicker/calendars

saeidi-dev avatar Nov 12 '22 06:11 saeidi-dev

after six months, still, no update about this feature. awesome 😶

rsangin avatar Nov 27 '22 06:11 rsangin

I released the package for this issue, please visit my library : https://www.npmjs.com/package/ng-met-antd

thanks @moein459

psychomet avatar Dec 19 '22 13:12 psychomet

I released the package for this issue, please visit my library : https://www.npmjs.com/package/nz-date-picker-jalali

thanks @moein459

this package does not work for my project. I have been waiting for months for this issue to be resolved :( @hullis @wenqi73 @simplejason

ali-memar avatar Dec 24 '22 10:12 ali-memar

Can you explain your planning for this task? @hullis

saeidi-dev avatar Jan 17 '23 09:01 saeidi-dev

I released the package for this issue, please visit my library : https://www.npmjs.com/package/nz-date-picker-jalali thanks @moein459

this package does not work for my project. I have been waiting for months for this issue to be resolved :( @hullis @wenqi73 @simplejason

check new package bro: https://www.npmjs.com/package/ng-met-antd

psychomet avatar Apr 20 '23 09:04 psychomet

Is this going to happen anytime soon? :( it's been years...

Sina7312 avatar Jan 13 '24 09:01 Sina7312

@saeidi-dev Didn't you find a way to have this feature without consider the package update? I really do need this one

sajjadBayat32 avatar Feb 24 '24 10:02 sajjadBayat32

@saeidi-dev Didn't you find a way to have this feature without consider the package update? I really do need this one

You can use this package https://www.npmjs.com/package/ng-met-antd

saeidi-dev avatar Feb 24 '24 11:02 saeidi-dev

@saeidi-dev Didn't you find a way to have this feature without consider the package update? I really do need this one

You can use this package https://www.npmjs.com/package/ng-met-antd

But it's not compatible with angular 17. I couldn't use it

sajjadBayat32 avatar Feb 24 '24 11:02 sajjadBayat32

@saeidi-dev Didn't you find a way to have this feature without consider the package update? I really do need this one

You can use this package https://www.npmjs.com/package/ng-met-antd

But it's not compatible with angular 17. I couldn't use it

I am using this package on version 17

saeidi-dev avatar Feb 24 '24 12:02 saeidi-dev