Favivon - Correção

This commit is contained in:
2026-05-30 19:59:39 -03:00
parent 76ddaa815d
commit d7dfd221f0
32859 changed files with 5459654 additions and 404 deletions
+20
View File
@@ -0,0 +1,20 @@
import { DateLib, type DateLibOptions } from "../classes/DateLib.js";
/**
* Formats the caption of the month.
*
* @defaultValue Locale-specific month/year order (e.g., "November 2022").
* @param month The date representing the month.
* @param options Configuration options for the date library.
* @param dateLib The date library to use for formatting. If not provided, a new
* instance is created.
* @returns The formatted caption as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
export declare function formatCaption(month: Date, options?: DateLibOptions, dateLib?: DateLib): string;
/**
* @private
* @deprecated Use {@link formatCaption} instead.
* @group Formatters
*/
export declare const formatMonthCaption: typeof formatCaption;
+23
View File
@@ -0,0 +1,23 @@
import { DateLib } from "../classes/DateLib.js";
/**
* Formats the caption of the month.
*
* @defaultValue Locale-specific month/year order (e.g., "November 2022").
* @param month The date representing the month.
* @param options Configuration options for the date library.
* @param dateLib The date library to use for formatting. If not provided, a new
* instance is created.
* @returns The formatted caption as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
export function formatCaption(month, options, dateLib) {
const lib = dateLib ?? new DateLib(options);
return lib.formatMonthYear(month);
}
/**
* @private
* @deprecated Use {@link formatCaption} instead.
* @group Formatters
*/
export const formatMonthCaption = formatCaption;
+14
View File
@@ -0,0 +1,14 @@
import { DateLib, type DateLibOptions } from "../classes/DateLib.js";
/**
* Formats the day date shown in the day cell.
*
* @defaultValue `d` (e.g., "1").
* @param date The date to format.
* @param options Configuration options for the date library.
* @param dateLib The date library to use for formatting. If not provided, a new
* instance is created.
* @returns The formatted day as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
export declare function formatDay(date: Date, options?: DateLibOptions, dateLib?: DateLib): string;
+16
View File
@@ -0,0 +1,16 @@
import { DateLib } from "../classes/DateLib.js";
/**
* Formats the day date shown in the day cell.
*
* @defaultValue `d` (e.g., "1").
* @param date The date to format.
* @param options Configuration options for the date library.
* @param dateLib The date library to use for formatting. If not provided, a new
* instance is created.
* @returns The formatted day as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
export function formatDay(date, options, dateLib) {
return (dateLib ?? new DateLib(options)).format(date, "d");
}
@@ -0,0 +1,13 @@
import { type DateLib } from "../classes/DateLib.js";
/**
* Formats the month for the dropdown option label.
*
* @defaultValue The localized full month name.
* @param month The date representing the month.
* @param dateLib The date library to use for formatting. Defaults to
* `defaultDateLib`.
* @returns The formatted month name as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
export declare function formatMonthDropdown(month: Date, dateLib?: DateLib): string;
@@ -0,0 +1,15 @@
import { defaultDateLib } from "../classes/DateLib.js";
/**
* Formats the month for the dropdown option label.
*
* @defaultValue The localized full month name.
* @param month The date representing the month.
* @param dateLib The date library to use for formatting. Defaults to
* `defaultDateLib`.
* @returns The formatted month name as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
export function formatMonthDropdown(month, dateLib = defaultDateLib) {
return dateLib.format(month, "LLLL");
}
@@ -0,0 +1,12 @@
/**
* Formats the week number.
*
* @defaultValue The week number as a string, with a leading zero for single-digit numbers.
* @param weekNumber The week number to format.
* @param dateLib The date library to use for formatting. Defaults to
* `defaultDateLib`.
* @returns The formatted week number as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
export declare function formatWeekNumber(weekNumber: number, dateLib?: import("../classes/DateLib.js").DateLib): string;
+18
View File
@@ -0,0 +1,18 @@
import { defaultDateLib } from "../classes/DateLib.js";
/**
* Formats the week number.
*
* @defaultValue The week number as a string, with a leading zero for single-digit numbers.
* @param weekNumber The week number to format.
* @param dateLib The date library to use for formatting. Defaults to
* `defaultDateLib`.
* @returns The formatted week number as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
export function formatWeekNumber(weekNumber, dateLib = defaultDateLib) {
if (weekNumber < 10) {
return dateLib.formatNumber(`0${weekNumber.toLocaleString()}`);
}
return dateLib.formatNumber(`${weekNumber.toLocaleString()}`);
}
@@ -0,0 +1,9 @@
/**
* Formats the header for the week number column.
*
* @defaultValue An empty string `""`.
* @returns The formatted week number header as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
export declare function formatWeekNumberHeader(): string;
@@ -0,0 +1,11 @@
/**
* Formats the header for the week number column.
*
* @defaultValue An empty string `""`.
* @returns The formatted week number header as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
export function formatWeekNumberHeader() {
return ``;
}
@@ -0,0 +1,14 @@
import { DateLib, type DateLibOptions } from "../classes/DateLib.js";
/**
* Formats the name of a weekday to be displayed in the weekdays header.
*
* @defaultValue `cccccc` (e.g., "Mo" for Monday).
* @param weekday The date representing the weekday.
* @param options Configuration options for the date library.
* @param dateLib The date library to use for formatting. If not provided, a new
* instance is created.
* @returns The formatted weekday name as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
export declare function formatWeekdayName(weekday: Date, options?: DateLibOptions, dateLib?: DateLib): string;
+16
View File
@@ -0,0 +1,16 @@
import { DateLib } from "../classes/DateLib.js";
/**
* Formats the name of a weekday to be displayed in the weekdays header.
*
* @defaultValue `cccccc` (e.g., "Mo" for Monday).
* @param weekday The date representing the weekday.
* @param options Configuration options for the date library.
* @param dateLib The date library to use for formatting. If not provided, a new
* instance is created.
* @returns The formatted weekday name as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
export function formatWeekdayName(weekday, options, dateLib) {
return (dateLib ?? new DateLib(options)).format(weekday, "cccccc");
}
@@ -0,0 +1,18 @@
import { type DateLib } from "../classes/DateLib.js";
/**
* Formats the year for the dropdown option label.
*
* @param year The year to format.
* @param dateLib The date library to use for formatting. Defaults to
* `defaultDateLib`.
* @returns The formatted year as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
export declare function formatYearDropdown(year: Date, dateLib?: DateLib): string;
/**
* @private
* @deprecated Use `formatYearDropdown` instead.
* @group Formatters
*/
export declare const formatYearCaption: typeof formatYearDropdown;
@@ -0,0 +1,20 @@
import { defaultDateLib } from "../classes/DateLib.js";
/**
* Formats the year for the dropdown option label.
*
* @param year The year to format.
* @param dateLib The date library to use for formatting. Defaults to
* `defaultDateLib`.
* @returns The formatted year as a string.
* @group Formatters
* @see https://daypicker.dev/docs/translation#custom-formatters
*/
export function formatYearDropdown(year, dateLib = defaultDateLib) {
return dateLib.format(year, "yyyy");
}
/**
* @private
* @deprecated Use `formatYearDropdown` instead.
* @group Formatters
*/
export const formatYearCaption = formatYearDropdown;
+7
View File
@@ -0,0 +1,7 @@
export * from "./formatCaption.js";
export * from "./formatDay.js";
export * from "./formatMonthDropdown.js";
export * from "./formatWeekdayName.js";
export * from "./formatWeekNumber.js";
export * from "./formatWeekNumberHeader.js";
export * from "./formatYearDropdown.js";
+7
View File
@@ -0,0 +1,7 @@
export * from "./formatCaption.js";
export * from "./formatDay.js";
export * from "./formatMonthDropdown.js";
export * from "./formatWeekdayName.js";
export * from "./formatWeekNumber.js";
export * from "./formatWeekNumberHeader.js";
export * from "./formatYearDropdown.js";