1.0.1 • Published 1 month ago

@288-toolkit/html-time v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 month ago

Html-time

pnpm i @288-toolkit/html-time

A convenient wrapper component arund the html element.

Props

  • date (Date): The date to display
  • formatOptions (FormatDateOptions): The date formatting options (see format package)

Slot props

  • formattedDate (string): The formatted date

Examples

<Time
	date={new Date('2023-04-17T21:34:50.360Z')}
	formatOptions={{ day: 'numeric', month: 'long', year: 'numeric' }}
/>
<Time
	date={new Date('2023-04-17T21:34:50.360Z')}
	formatOptions={{ day: 'numeric', month: 'long' }}
	let:formattedDate
>
	<span class="text-[red]">
		{formattedDate}
	</span>
</Time>
1.0.1

1 month ago

1.0.0

1 month ago