Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
uvarov-frontend committed Dec 3, 2024
1 parent fd75a66 commit 659c1e7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/en/learn/components-for-libraries-react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default VanillaCalendar;
Then, import the created `VanillaCalendar` component into your React application where you plan to display the calendar.

```tsx
import VanillaCalendar from "./VanillaCalendar";
import VanillaCalendar from './VanillaCalendar';
```

Use the created component.
Expand Down
2 changes: 1 addition & 1 deletion docs/en/learn/components-for-libraries-vue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Then import the created `VanillaCalendar` component into your Vue application wh
```vue
<script setup lang="ts">
// ...
import VanillaCalendar from "./VanillaCalendar.vue";
import VanillaCalendar './VanillaCalendar.vue';
// ...
</script>
```
Expand Down
8 changes: 4 additions & 4 deletions docs/en/reference/utilities.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ There are 4 utilities in total, and they are functions that can be used anywhere
1. **`parseDates(dates: string[])`** — Takes an array of date ranges using a delimiter between dates in the string format `FormatDateString ('YYYY-MM-DD')`. Returns an array of dates in the string format `FormatDateString ('YYYY-MM-DD')`.
```ts
import { parseDates } from 'vanilla-calendar-pro/utils';
parseDates(['2024-12-12:2024-12-15']) // return: ['2024-12-12', '2024-12-13', '2024-12-14', '2024-12-15']
parseDates(['2024-12-12:2024-12-15']); // return: ['2024-12-12', '2024-12-13', '2024-12-14', '2024-12-15']
```

2. **`getDateString(date: Date)`** — Takes a date of type `Date`. Returns the date in the string format `FormatDateString ('YYYY-MM-DD')`.
```ts
import { getDateString } from 'vanilla-calendar-pro/utils';
getDateString(new Date('24.12.2024')) // return: 2024-12-24
getDateString(new Date('24.12.2024')); // return: 2024-12-24
```

3. **`getDate(date: FormatDateString)`** — Takes a date in string format, e.g., `FormatDateString ('YYYY-MM-DD')`. Returns a date of type `Date`.
```ts
import { getDate } from 'vanilla-calendar-pro/utils';
getDate(new Date('2024-12-12')) // return: Tue Dec 24 2024 00:00:00 GMT
getDate('2024-12-12'); // return: Tue Dec 24 2024 00:00:00 GMT
```

4. **`getWeekNumber(date: FormatDateString, weekStartDay: WeekDayID)`** — Takes a date in string format `FormatDateString ('YYYY-MM-DD')` and the week start day, specifically its `id` of type `number` from 0 to 6. Returns an object `{ year: yearNumber, week: weekNumber }` for the date specified in the arguments.
```ts
import { getWeekNumber } from 'vanilla-calendar-pro/utils';
getWeekNumber('2024-12-12', 1) // return: {year: 2024, week: 50}
getWeekNumber('2024-12-12', 1); // return: {year: 2024, week: 50}
```
2 changes: 1 addition & 1 deletion docs/ru/learn/components-for-libraries-react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default VanillaCalendar;
Затем импортируйте созданный компонент `VanillaCalendar` в ваше приложение React, где вы планируете отображать календарь.

```tsx
import VanillaCalendar from "./VanillaCalendar";
import VanillaCalendar from './VanillaCalendar';
```

Используйте созданный компонент.
Expand Down
2 changes: 1 addition & 1 deletion docs/ru/learn/components-for-libraries-vue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ onMounted(() => {
```vue
<script setup lang="ts">
// ...
import VanillaCalendar from "./VanillaCalendar.vue";
import VanillaCalendar from './VanillaCalendar.vue';
// ...
</script>
```
Expand Down
8 changes: 4 additions & 4 deletions docs/ru/reference/utilities.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ section: 2
1. **`parseDates(dates: string[])`** — принимает на вход массив диапазонов дат с использованием разделителя между датами в строковом формате типа `FormatDateString ('YYYY-MM-DD')`. Возвращает массив дат в строковом формате типа `FormatDateString ('YYYY-MM-DD')`.
```ts
import { parseDates } from 'vanilla-calendar-pro/utils';
parseDates(['2024-12-12:2024-12-15']) // возвращает: ['2024-12-12', '2024-12-13', '2024-12-14', '2024-12-15']
parseDates(['2024-12-12:2024-12-15']); // возвращает: ['2024-12-12', '2024-12-13', '2024-12-14', '2024-12-15']
```

2. **`getDateString(date: Date)`** — принимает на вход дату типа `Date`. Возвращает дату в строковом формате типа `FormatDateString ('YYYY-MM-DD')`.
```ts
import { getDateString } from 'vanilla-calendar-pro/utils';
getDateString(new Date('24.12.2024')) // возвращает: 2024-12-24
getDateString(new Date('24.12.2024')); // возвращает: 2024-12-24
```

3. **`getDate(date: FormatDateString)`** — принимает дату в строковом формате, например `FormatDateString ('YYYY-MM-DD')`. Возвращает дату типа `Date`.
```ts
import { getDate } from 'vanilla-calendar-pro/utils';
getDate(new Date('2024-12-12')) // возвращает: Tue Dec 24 2024 00:00:00 GMT
getDate('2024-12-12'); // возвращает: Tue Dec 24 2024 00:00:00 GMT
```

4. **`getWeekNumber(date: FormatDateString, weekStartDay: WeekDayID)`** — принимает на вход дату в строковом формате типа `FormatDateString ('YYYY-MM-DD')` и день начала недели, а точнее его `id` с типом `number` от 0 до 6. Возвращает объект `{ year: yearNumber, week: weekNumber }` для даты, указанной в аргументах.
```ts
import { getWeekNumber } from 'vanilla-calendar-pro/utils';
getWeekNumber('2024-12-12', 1) // возвращает: {year: 2024, week: 50}
getWeekNumber('2024-12-12', 1); // возвращает: {year: 2024, week: 50}
```

0 comments on commit 659c1e7

Please sign in to comment.