UNPKG

@mantine/dates

Version:

Calendars, date and time pickers based on Mantine components

1 lines 1.25 kB
{"version":3,"file":"TimeValue.cjs","names":["getFormattedTime"],"sources":["../../../src/components/TimeValue/TimeValue.tsx"],"sourcesContent":["import type { TimePickerAmPmLabels, TimePickerFormat } from '../TimePicker';\nimport { getFormattedTime } from './get-formatted-time/get-formatted-time';\n\nexport interface TimeValueProps {\n /** Time to format */\n value: string | Date;\n\n /** Time format @default '24h' */\n format?: TimePickerFormat;\n\n /** AM/PM labels @default { am: 'AM', pm: 'PM' } */\n amPmLabels?: TimePickerAmPmLabels;\n\n /** Determines whether seconds should be displayed @default false */\n withSeconds?: boolean;\n}\n\nexport function TimeValue({\n value,\n format = '24h',\n amPmLabels = { am: 'AM', pm: 'PM' },\n withSeconds = false,\n}: TimeValueProps) {\n return <>{getFormattedTime({ value, format, amPmLabels, withSeconds })}</>;\n}\n\nTimeValue.displayName = '@mantine/dates/TimeValue';\n\nexport namespace TimeValue {\n export type Props = TimeValueProps;\n}\n"],"mappings":";;;;AAiBA,SAAgB,UAAU,EACxB,OACA,SAAS,OACT,aAAa;CAAE,IAAI;CAAM,IAAI;AAAK,GAClC,cAAc,SACG;CACjB,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAA,kBAAA,UAAA,EAAA,UAAGA,2BAAAA,iBAAiB;EAAE;EAAO;EAAQ;EAAY;CAAY,CAAC,EAAI,CAAA;AAC3E;AAEA,UAAU,cAAc"}