datepicker-i18n.d.ts 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import { NgbDateStruct } from './ngb-date-struct';
  2. export declare function NGB_DATEPICKER_18N_FACTORY(locale: any): NgbDatepickerI18nDefault;
  3. /**
  4. * A service supplying i18n data to the datepicker component.
  5. *
  6. * The default implementation of this service uses the Angular locale and registered locale data for
  7. * weekdays and month names (as explained in the Angular i18n guide).
  8. *
  9. * It also provides a way to i18n data that depends on calendar calculations, like aria labels, day, week and year
  10. * numerals. For other static labels the datepicker uses the default Angular i18n.
  11. *
  12. * See the [i18n demo](#/components/datepicker/examples#i18n) and
  13. * [Hebrew calendar demo](#/components/datepicker/calendars#hebrew) on how to extend this class and define
  14. * a custom provider for i18n.
  15. */
  16. export declare abstract class NgbDatepickerI18n {
  17. /**
  18. * Returns the short weekday name to display in the heading of the month view.
  19. *
  20. * With default calendar we use ISO 8601: 'weekday' is 1=Mon ... 7=Sun.
  21. */
  22. abstract getWeekdayShortName(weekday: number): string;
  23. /**
  24. * Returns the short month name to display in the date picker navigation.
  25. *
  26. * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
  27. */
  28. abstract getMonthShortName(month: number, year?: number): string;
  29. /**
  30. * Returns the full month name to display in the date picker navigation.
  31. *
  32. * With default calendar we use ISO 8601: 'month' is 1=Jan ... 12=Dec.
  33. */
  34. abstract getMonthFullName(month: number, year?: number): string;
  35. /**
  36. * Returns the value of the `aria-label` attribute for a specific date.
  37. *
  38. * @since 2.0.0
  39. */
  40. abstract getDayAriaLabel(date: NgbDateStruct): string;
  41. /**
  42. * Returns the textual representation of a day that is rendered in a day cell.
  43. *
  44. * @since 3.0.0
  45. */
  46. getDayNumerals(date: NgbDateStruct): string;
  47. /**
  48. * Returns the textual representation of a week number rendered by datepicker.
  49. *
  50. * @since 3.0.0
  51. */
  52. getWeekNumerals(weekNumber: number): string;
  53. /**
  54. * Returns the textual representation of a year that is rendered in the datepicker year select box.
  55. *
  56. * @since 3.0.0
  57. */
  58. getYearNumerals(year: number): string;
  59. }
  60. export declare class NgbDatepickerI18nDefault extends NgbDatepickerI18n {
  61. private _locale;
  62. private _weekdaysShort;
  63. private _monthsShort;
  64. private _monthsFull;
  65. constructor(_locale: string);
  66. getWeekdayShortName(weekday: number): string;
  67. getMonthShortName(month: number): string;
  68. getMonthFullName(month: number): string;
  69. getDayAriaLabel(date: NgbDateStruct): string;
  70. }