Skip to content

Commit

Permalink
[#1844] Add manual input example to the docs (#1913)
Browse files Browse the repository at this point in the history
* Add example, fix RU version

* manual example file

* Minor. Typo fix.

Co-authored-by: Vitaly <vitaly.raichev@epicmax.co>

Co-authored-by: Maksim Nedoshev <m0ksem1337@gmail.com>
Co-authored-by: Vitaly <vitaly.raichev@epicmax.co>
  • Loading branch information
3 people authored Jun 16, 2022
1 parent 508fb2a commit 28f829a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/docs/src/locales/en/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3000,9 +3000,13 @@
"title": "Formatting",
"text": "You can pass the format function to VaDateInput which will format input text like you want to. This way you can use any format that you want. For example, you can use [date-fns](https://date-fns.org/v2.23.0/docs/format)[[target=_blank]]."
},
"manual": {
"title": "Date Manual Input",
"text": "You can add `manual-input` attribute to allow user input text from keyboard manually."
},
"input": {
"title": "Input date",
"text": "You can allow user to input text from keyboard. You need to set readonly prop as true. You can pass the parse function to VaDateInput which will parse input text like you want to. This way you can use any format that you want. For example, you can use [date-fns](https://date-fns.org/v2.23.0/docs/format)[[target=_blank]] to parse date string. By default we parse this input using standard `Date.parse` method."
"title": "Parsing",
"text": "You can pass the parse function to VaDateInput which will parse input text like you want to. This way you can use any format that you want. For example, you can use [date-fns](https://date-fns.org/v2.23.0/docs/format)[[target=_blank]] to parse date string. By default we parse this input using standard `Date.parse` method."
},
"inputProps": {
"title": "Input props",
Expand Down
8 changes: 8 additions & 0 deletions packages/docs/src/locales/ru/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -2888,6 +2888,14 @@
"title": "Форматирование",
"text": "Вы можете передать функцию форматирования в `VaDateInput`, которая будет форматировать вводимый текст так, как вы хотите. Таким образом, вы можете использовать любой формат, который хотите. Например, вы можете использовать [date-fns](https://date-fns.org/v2.23.0/docs/format)[[target=_blank]]"
},
"manual": {
"title": "Пользовательский ввод",
"text": "Вы можете дать пользователю вводить дату вручную. Для этого добавьте атрибут `manual-input`"
},
"input": {
"title": "Парсинг",
"text": "Вы можете добавить функцию парсинга к VaDateInput чтобы распознавать введеный текст тем или иным образом. Это позволит вам использовать любое форматирование. Например использовать [date-fns](https://date-fns.org/v2.23.0/docs/format)[[target=_blank]] чтобы парсить строку. По умолчанию мы используем для этого метод `Date.parse`."
},
"inputProps": {
"title": "Передаваемые свойства",
"text": "Вы можете передать свойства в `VaDateInput`"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<template>
<va-date-input v-model="value" manual-input />
</template>

<script>
export default {
data () {
return { value: new Date() }
},
}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ const config: ApiDocsBlock[] = [
'formatting',
),

...block.exampleBlock(
'dateInput.examples.manual.title',
'dateInput.examples.manual.text',
'manual',
),

...block.exampleBlock(
'dateInput.examples.input.title',
'dateInput.examples.input.text',
Expand Down

0 comments on commit 28f829a

Please sign in to comment.