-
Notifications
You must be signed in to change notification settings - Fork 4k
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
reflector(moment): remove the dependency of moment #761
Comments
Draft design doc for anyone works on thisBackgroundAngular has dropped dependency of Intl API and uses self-provided locale data extracted from CLDR starts from v5. UsageAn Angular application needs to define which locale to support by registering the locale data, like: import { registerLocaleData } from '@angular/common';
import localeFr from '@angular/common/locales/fr';
import localeZh from '@angular/common/locales/zh';
// the second parameter 'fr', 'zh' are optional
registerLocaleData(localeFr, 'fr');
registerLocaleData(localeFr, 'zh'); More details can be found in Angular i18n doc. All registered locale data would be available in runtime. Then the application needs to provide the But the library should provide an option to override ImplementationFor template formatting, just use the DatePipe, it will automatically use the locale provided by For logic formatting, Angular would provide something like @NgModule({
providers: [ DatePipe ]
})
class LocaleModule { }
@Injectable()
class LocaleService {
constructor(private datePipe: DatePipe) { }
formatDate(date: Date, format: string, locale: string): string {
return this.datePipe.transform(date, format, /* timezone */ undefined, locale);
}
} For other utilities like plus one day, can be achieved by some tiny 3rd-party libraries like date-fns. But could still have some problem for typing in CommonJS module integration. (Should only import the exact helpers for size consideration) |
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread. |
…ker against to ant-design (NG-ZORRO#1254) close NG-ZORRO#1367 close NG-ZORRO#1267 close NG-ZORRO#1107 close NG-ZORRO#1097 close NG-ZORRO#1094 close NG-ZORRO#1079 close NG-ZORRO#1063 close NG-ZORRO#1060 close NG-ZORRO#1060 close NG-ZORRO#1046 close NG-ZORRO#1034 close NG-ZORRO#955 close NG-ZORRO#906 close NG-ZORRO#761 close NG-ZORRO#707 close NG-ZORRO#741 close NG-ZORRO#646 * refactor(module:date-picker): TODO: complete all complete more complete date wrapper, need more flexiable with APIs of value select and change complete parts of footer the datepicker almost complete commit to avoid side-effects with experiments import the legacy timepicker, date-picker almost done complete the common apis for datepicker support all API for date-picker (which related to timepicker needs tebe complete) split the date picker into more flexable components, pending for next range-picker combine range-popup into date-popup, need self-testing plug out the common abstract picker for both single/range picker the range picker is almost done, but lots of work need todo still soft remove legacy time-picker compat with the latest time-picker re-render the content of picker when open add month-picker, need tobe done done with month-picker & ready to develop week-picker add support of week-picker support ngModel for all pickers complete parts of demos support timePickerDisabled && timePickerDisabled (need testing) support time-picker for date/range picker and more options like disabledDate/disabledTime complete all demo and the chinese doc add some testings for date-picker component add more testing for date-picker component fix problems of overlay's origin and backdrop with open add testing for date-picker with ngModel done testings for date-picker, start to add testings for range-picker add testings for range picker increase coverage of testings for date picker module add testings for month-picker increase more testing coverage complete more testings for date picker module * trimming relates for build packaging * complete the zh/en documents * support animations when hide/show * fix(module:date-picker): change default to ngModel * fix(module:date-picker): change default to ngModel * fix the range's wrong default value setting * make CandyDate changes into range picker testing * aim to trigger ci test(module:date-picker): fix month-picker test
What problem does this feature solve?
reduce the package size since angular has provided all the locales we need
What does the proposed API look like?
may bring some break changes.
The text was updated successfully, but these errors were encountered: