import React from "react"; import classnames from "classnames"; import { buildAriaProps, buildCss, buildDataProps } from "../utilities/props"; import { globalProps } from "../utilities/globalProps"; import DateTime from '../pb_kit/dateTime'; import Body from "../pb_body/_body"; import Caption from "../pb_caption/_caption"; import Icon from "../pb_icon/_icon"; import Title from "../pb_title/_title"; type PbDateProps = { alignment?: "left" | "center" | "right"; aria?: { [key: string]: string }; className?: string; data?: { [key: string]: string }; id?: string; showDayOfWeek?: boolean; showIcon?: boolean; size?: "sm" | "md" | "lg"; unstyled?: boolean; value: Date; }; const PbDate = (props: PbDateProps) => { const { aria = {}, alignment = "left", className, data = {}, id, showDayOfWeek = false, showIcon = false, size = "md", unstyled = false, value, } = props; const weekday = DateTime.toWeekday(value); const month = DateTime.toMonth(value); const day = DateTime.toDay(value); const year = DateTime.toYear(value); const currentYear = new Date().getFullYear(); const ariaProps = buildAriaProps(aria); const dataProps = buildDataProps(data); const classes = classnames( buildCss("pb_date_kit", alignment), globalProps(props), className ); return (