Skip to content

Commit

Permalink
docs: update for date import path changes
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Oct 30, 2023
1 parent f8237ce commit c8f1f57
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 22 deletions.
3 changes: 1 addition & 2 deletions packages/docs/src/components/app/bar/NotificationsMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@
// Composables
import { useCosmic } from '@/composables/cosmic'
import { useDate } from 'vuetify/labs/date'
import { useDisplay } from 'vuetify'
import { useDate, useDisplay } from 'vuetify'
import { useGtag } from 'vue-gtag-next'
import { useI18n } from 'vue-i18n'
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/components/doc/Releases.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@

<script setup lang="ts">
// Composables
import { useDate } from 'vuetify/labs/date'
import { useDate } from 'vuetify'
import { useI18n } from 'vue-i18n'
import { useDisplay, version } from 'vuetify'
import { useRoute, useRouter } from 'vue-router'
Expand Down
5 changes: 1 addition & 4 deletions packages/docs/src/data/nav.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"aliasing",
"application-layout",
"blueprints",
"dates",
"display-and-platform",
"global-configuration",
"icon-fonts",
Expand Down Expand Up @@ -220,10 +221,6 @@
"server-side-tables"
]
},
{
"title": "dates",
"subfolder": "features"
},
{
"title": "date-pickers",
"subfolder": "components"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@
</template>

<script setup>
import { useDate } from 'vuetify/labs/date'
import { useDate } from 'vuetify'
import { ref } from 'vue'
const adapter = useDate()
const date = ref('2018-03-02')
const adapter = useDate()
function allowedDates (val) {
return parseInt(adapter.toISO(val).split('-')[2], 10) % 2 === 0
}
</script>

<script>
import { useDate } from 'vuetify/labs/date'
import { useDate } from 'vuetify'
const adapter = useDate()
Expand Down
19 changes: 11 additions & 8 deletions packages/docs/src/pages/en/features/dates.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
emphasized: false
emphasized: true
meta:
title: Dates
description: Vuetify has first party date support that can easily be swapped for another date library
Expand All @@ -9,22 +9,22 @@ related:
- /features/global-configuration/
- /features/treeshaking/
features:
github: /labs/date/
github: /composables/date/
label: 'E: date'
report: true
---

# Dates

Easily hook up date libraries that are used for components that require date functionality.
Easily hook up date libraries that are used for components such as Date Picker and Calendar that require date functionality.

<page-features />

<entry />

::: warning
::: success

This feature requires [v3.2.0 (Orion)](/getting-started/release-notes/?version=v3.2.0)
This feature was introduced in [v3.4.0 (Blackguard)](/getting-started/release-notes/?version=v3.4.0)

:::

Expand All @@ -36,7 +36,7 @@ The following example demonstrates explicitly importing the Vuetify date adapter

```js { resource="src/plugins/vuetify.js" }
import { createVuetify } from 'vuetify'
import { VuetifyDateAdapter } from 'vuetify/labs/date/adapters/vuetify'
import { VuetifyDateAdapter } from 'vuetify/date/adapters/vuetify'

export default createVuetify({
date: {
Expand All @@ -49,7 +49,7 @@ Within your application, import the **useDate** function and use it to access th

```html { resource="src/views/Date.vue" }
<script setup>
import { useDate } from 'vuetify/labs/date'
import { useDate } from 'vuetify'
const date = useDate()
Expand All @@ -58,7 +58,9 @@ Within your application, import the **useDate** function and use it to access th
```

::: info

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

:::

### Format options
Expand All @@ -80,7 +82,7 @@ The following example shows how to use the date composable to format a date stri

```html { resource="src/views/Date.vue" }
<script setup>
import { useDate } from 'vuetify/labs/date'
import { useDate } from 'vuetify'
const date = useDate()
Expand Down Expand Up @@ -150,6 +152,7 @@ export interface DateAdapter<Date> {
getYear (date: Date): number
getNextYear (date: Date): Date
setYear (date: Date, year: number): Date
getDate (date: Date): number
getDiff (date: Date, comparing: Date | string, unit?: string): number
getWeekArray (date: Date): Date[][]
getWeekdays (): string[]
Expand Down
2 changes: 0 additions & 2 deletions packages/docs/src/pages/en/labs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ The following is a list of available and up-and-coming components for use with L
| [v-data-table-row](/api/v-data-table-row/) | Data table reusable row component | |
| [v-data-table-rows](/api/v-data-table-rows/) | Data table reusable rows component | |
| [v-data-table-column](/api/v-data-table-column/) | Data table reusable column component | |
| **Dates** | [Usage](/features/dates/) | [v3.2.0&nbsp;(Orion)](/getting-started/release-notes/?version=v3.2.0) |
| [useDate](/api/use-date/) | The date composable is used by components that require date functionality | |
| **Date picker** | [Usage](/components/date-pickers/) | [v3.3.4&nbsp;(Icarus)](/getting-started/release-notes/?version=v3.3.4) |
| [v-date-picker](/api/v-date-picker/) | Primary Component | |
| **OTP input** | [Usage](/components/otp-input/) | [v3.3.11&nbsp;(Icarus)](/getting-started/release-notes/?version=v3.3.11) |
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/store/banners.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Composables
import { useCosmic } from '@/composables/cosmic'
import { useDate } from 'vuetify/labs/date'
import { useDate } from 'vuetify'

// Utilities
import { defineStore } from 'pinia'
Expand Down

0 comments on commit c8f1f57

Please sign in to comment.