Skip to content

Commit

Permalink
fix: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alaa-yahia committed Sep 26, 2024
1 parent 476936e commit f8b7345
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 26 deletions.
4 changes: 2 additions & 2 deletions collections/forms/i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2024-09-25T00:10:28.046Z\n"
"PO-Revision-Date: 2024-09-25T00:10:28.048Z\n"
"POT-Creation-Date: 2024-09-26T14:15:11.940Z\n"
"PO-Revision-Date: 2024-09-26T14:15:11.941Z\n"

msgid "Upload file"
msgstr "Upload file"
Expand Down
2 changes: 1 addition & 1 deletion collections/ui/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ import { CalendarInput } from '@dhis2/ui'
|maxDate|string|||The maximum selectable date|
|minDate|string|||The minimum selectable date|
|numberingSystem|string|||numbering system to use - full list here https://github.com/dhis2/multi-calendar-dates/blob/main/src/constants/numberingSystems.ts|
|strictValidation|boolean|||Whether to use strict validation|
|strictValidation|boolean|||Whether to use strict validation by showing errors for out-of-range dates when enabled (default), and warnings when disabled|
|timeZone|string|||the timeZone to use|
|weekDayFormat|'narrow' │ 'short' │ 'long'|`'narrow'`||the format to display for the week day, i.e. Monday (long), Mon (short), M (narrow)|
|width|string|`'240px'`||the width of the calendar component|
Expand Down
2 changes: 1 addition & 1 deletion components/calendar/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import { CalendarInput } from '@dhis2/ui'
|maxDate|string|||The maximum selectable date|
|minDate|string|||The minimum selectable date|
|numberingSystem|string|||numbering system to use - full list here https://github.com/dhis2/multi-calendar-dates/blob/main/src/constants/numberingSystems.ts|
|strictValidation|boolean|||Whether to use strict validation|
|strictValidation|boolean|||Whether to use strict validation by showing errors for out-of-range dates when enabled (default), and warnings when disabled|
|timeZone|string|||the timeZone to use|
|weekDayFormat|'narrow' │ 'short' │ 'long'|`'narrow'`||the format to display for the week day, i.e. Monday (long), Mon (short), M (narrow)|
|width|string|`'240px'`||the width of the calendar component|
5 changes: 1 addition & 4 deletions components/calendar/src/calendar-input/calendar-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const CalendarInput = ({
locale,
numberingSystem,
weekDayFormat,
timeZone,
width,
cellSize,
clearable,
Expand Down Expand Up @@ -237,10 +236,8 @@ CalendarInput.propTypes = {
minDate: PropTypes.string,
/** numbering system to use - full list here https://github.com/dhis2/multi-calendar-dates/blob/main/src/constants/numberingSystems.ts */
numberingSystem: PropTypes.string,
/** Whether to use strict validation */
/** Whether to use strict validation by showing errors for out-of-range dates when enabled (default), and warnings when disabled */
strictValidation: PropTypes.bool,
/** the timeZone to use */
timeZone: PropTypes.string,
/** the format to display for the week day, i.e. Monday (long), Mon (short), M (narrow) */
weekDayFormat: PropTypes.oneOf(['narrow', 'short', 'long']),
/** the width of the calendar component */
Expand Down
26 changes: 12 additions & 14 deletions components/calendar/src/stories/calendar-input.prod.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,18 @@ export default {

const buildCalendar =
({ date, locale, calendar }) =>
() =>
(
<CalendarStoryWrapper
component={CalendarInput}
dir="ltr"
timeZone="Africa/Khartoum"
weekDayFormat="short"
date={date}
locale={locale}
calendar={calendar}
onDateSelect={() => {}}
/>
)
() => (
<CalendarStoryWrapper
component={CalendarInput}
dir="ltr"
timeZone="Africa/Khartoum"
weekDayFormat="short"
date={date}
locale={locale}
calendar={calendar}
onDateSelect={() => {}}
/>
)

export const EthiopicWithAmharic = buildCalendar({
calendar: 'ethiopic',
Expand Down Expand Up @@ -133,7 +132,6 @@ export function CalendarWithEditiableInput() {
}}
width={'700px'}
inputWidth="900px"
timeZone={'UTC'}
minDate={'2020-07-01'}
maxDate={'2020-07-09'}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Calendar
title: Calendar Input
---

import { Demo } from '@site/src/components/DemoComponent.jsx'
Expand Down Expand Up @@ -55,10 +55,10 @@ This demo shows how to set minimum and maximum allowed dates.

This demo demonstrates the use of strict validation for date input.

- When `strictValidation` is set to `true`:
- When `strictValidation` is set to `true` (default behavior):
The component displays error indicators if a user selects or inputs a date outside the specified minimum and maximum date range.

- When `strictValidation` is `false` (default behavior):
- When `strictValidation` is `false`:
The component shows warning indicators for dates outside the allowed range.

<Demo
Expand Down
2 changes: 1 addition & 1 deletion docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const sidebars = {
'components/alertbar',
'components/button',
'components/card',
'components/calendar',
'components/calendar-input',
'components/checkbox',
'components/chip',
'components/data-table',
Expand Down

0 comments on commit f8b7345

Please sign in to comment.