Skip to content

Commit

Permalink
chore: clean-up and tuning pass
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Apr 17, 2023
1 parent f81e8f3 commit 542a24d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
8 changes: 4 additions & 4 deletions packages/api-generator/src/locale/en/use-date.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"endOfMonth": "Returns the last day of the month.",
"startOfWeek": "Returns the first day of the week.",
"endOfWeek": "Returns the last day of the week.",
"startOfDay": "",
"endOfDay": "",
"startOfYear": "",
"endOfYear": "",
"startOfDay": "Returns the first second of the day.",
"endOfDay": "Returns the last second of the day.",
"startOfYear": "Returns the first day of the year.",
"endOfYear": "Returns the last day of the year.",
"isAfter": "Returns true if the first date is after the second date.",
"isEqual": "Returns true if the two dates are equal.",
"isSameDay": "Returns true if the two dates are the same day.",
Expand Down
9 changes: 8 additions & 1 deletion packages/docs/src/pages/en/features/dates.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
emphasized: true
meta:
title: Dates
description: Vuetify has first party date support that can easily be swapped for another date library
Expand All @@ -17,7 +18,7 @@ Easily hook up date libraries that are used for components that require date fun

## Usage

The date composable provides a shared architecture that is used by components such as date picker and calendar. The default implementation is built using the native Date object, but can be swapped out for another date library. The following example shows the default behavior of the date composable. If no other date adapter is given, the default Vuetify one is used.
The date composable provides a shared architecture that is used by components such as date picker and calendar. The default implementation is built using the native Date object, but can be swapped out for another date library. If no other date adapter is given, the default Vuetify one is used.

The follow example demonstrates explicitly importing the Vuetify date adapter and passing it to the date options.

Expand Down Expand Up @@ -48,6 +49,12 @@ Within your application, import the **useDate** function and use it to access th
</script>
```

<alert type="info">

For a list of all supported date adapters, visit the [date-io](https://github.com/dmtrKovalenko/date-io#projects) project repository.

</alert>

### Format options

The date composable supports the following date formatting options:
Expand Down
3 changes: 2 additions & 1 deletion packages/vuetify/src/composables/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { propsFactory } from '@/util'
import VuetifyDateAdapter from '@/adapters/vuetify'

// Types
import type { InjectionKey, PropType } from 'vue'
import type { DateAdapter } from '@/adapters/date-adapter'
import type { InjectionKey, PropType } from 'vue'

export interface DateInstance extends DateAdapter<Date> {
locale: string
Expand All @@ -32,6 +32,7 @@ export function createDate (options?: DateOptions) {
return options ?? { adapter: VuetifyDateAdapter }
}

// TODO: revisit this after it starts being implemented
export const makeDateProps = propsFactory({
displayDate: {
type: Object as PropType<Date>,
Expand Down

0 comments on commit 542a24d

Please sign in to comment.