Skip to content

Commit

Permalink
Merge branch 'main' into feature/line-calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
Pante authored Dec 5, 2024
2 parents 806232e + 242be5e commit 24321ff
Show file tree
Hide file tree
Showing 25 changed files with 673 additions and 177 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
working-directory: ./samples
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2.17.0
- uses: subosito/flutter-action@v2.18.0
with:
flutter-version: 3.24.x
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs_preview_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
ref: ${{ github.event.pull_request.head.ref }}

# Publish samples
- uses: subosito/flutter-action@v2.17.0
- uses: subosito/flutter-action@v2.18.0
with:
flutter-version: 3.24.x
cache: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/forui_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
flutter-version: [ 3.x ]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2.17.0
- uses: subosito/flutter-action@v2.18.0
with:
flutter-version: ${{ matrix.flutter-version }}
cache: true
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
with:
distribution: 'temurin'
java-version: 17
- uses: subosito/flutter-action@v2.17.0
- uses: subosito/flutter-action@v2.18.0
with:
flutter-version: ${{ matrix.flutter-version }}
cache: true
Expand All @@ -71,7 +71,7 @@ jobs:
flutter-version: [ 3.x ]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2.17.0
- uses: subosito/flutter-action@v2.18.0
with:
flutter-version: ${{ matrix.flutter-version }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/forui_hooks_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
flutter-version: [ 3.x ]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2.16.0
- uses: subosito/flutter-action@v2.18.0
with:
flutter-version: ${{ matrix.flutter-version }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/forui_hooks_presubmit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- uses: subosito/flutter-action@v2.16.0
- uses: subosito/flutter-action@v2.18.0
with:
cache: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/forui_presubmit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- uses: subosito/flutter-action@v2.17.0
- uses: subosito/flutter-action@v2.18.0
with:
cache: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/samples_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
flutter-version: [ 3.x ]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2.17.0
- uses: subosito/flutter-action@v2.18.0
with:
flutter-version: ${{ matrix.flutter-version }}
cache: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/samples_presubmit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- uses: subosito/flutter-action@v2.17.0
- uses: subosito/flutter-action@v2.18.0
with:
cache: true

Expand Down
54 changes: 29 additions & 25 deletions docs/pages/docs/form/calendar.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tabs } from 'nextra/components';
import { Callout, Tabs } from 'nextra/components';
import { Widget } from "../../../components/widget.tsx";
import LinkBadge from "../../../components/link-badge/link-badge.tsx";
import LinkBadgeGroup from "../../../components/link-badge/link-badge-group.tsx";
Expand All @@ -9,13 +9,16 @@ A date field component that allows users to enter and edit date.
The calendar pages are designed to be navigable through swipe gestures on mobile platforms, allowing left and right
swipes to transition between pages.

An [`FCalendarController`](https://pub.dev/documentation/forui/latest/forui.widgets.calendar/FCalendarController-class.html) is used
to customize the date selection behavior.
A [`FCalendarController`](https://pub.dev/documentation/forui/latest/forui.widgets.calendar/FCalendarController-class.html)
is used to customize the date selection behavior.

<LinkBadgeGroup>
<LinkBadge label="API Reference" href="https://pub.dev/documentation/forui/latest/forui.widgets.calendar/forui.widgets.calendar-library.html"/>
</LinkBadgeGroup>

<Callout type="info">
`FCalendar` and all `FCalendarController`s return `DateTime`s in UTC timezone, truncated to the nearest day.
</Callout>

<Tabs items={['Preview', 'Code']}>
<Tabs.Tab>
Expand All @@ -25,8 +28,8 @@ to customize the date selection behavior.
```dart
FCalendar(
controller: FCalendarController.date(initialSelection: selected),
start: DateTime.utc(2000),
end: DateTime.utc(2030),
start: DateTime(2000),
end: DateTime(2030),
);
```
</Tabs.Tab>
Expand All @@ -39,14 +42,15 @@ to customize the date selection behavior.
```dart
FCalendar(
controller: FCalendarController.date(
initialSelection: DateTime.utc(2024, 9, 13),
initialSelection: DateTime(2024, 9, 13),
selectable: (date) => allowedDates.contains(date),
),
start: DateTime.utc(2024),
end: DateTime.utc(2030),
today: DateTime.utc(2024, 7, 14),
dayBuilder: (context, data, child) => !child,
start: DateTime(2024),
end: DateTime(2030),
today: DateTime(2024, 7, 14),
initialType = FCalendarPickerType.yearMonth,
initialMonth = DateTime.utc(2024, 9),
initialMonth = DateTime(2024, 9),
onMonthChange: (date) => print(date),
onPress: (date) => print(date),
onLongPress: (date) => print(date),
Expand All @@ -63,8 +67,8 @@ FCalendar(
```dart {2}
FCalendar(
controller: FCalendarController.date(),
start: DateTime.utc(2000),
end: DateTime.utc(2030),
start: DateTime(2000),
end: DateTime(2030),
);
```
</Tabs.Tab>
Expand All @@ -79,11 +83,11 @@ FCalendar(
```dart {2-4}
FCalendar(
controller: FCalendarController.dates(
initialSelections: {DateTime.utc(2024, 7, 17), DateTime.utc(2024, 7, 20)},
initialSelections: {DateTime(2024, 7, 17), DateTime(2024, 7, 20)},
),
start: DateTime.utc(2000),
today: DateTime.utc(2024, 7, 15),
end: DateTime.utc(2030),
start: DateTime(2000),
today: DateTime(2024, 7, 15),
end: DateTime(2030),
);
```
</Tabs.Tab>
Expand All @@ -98,12 +102,12 @@ FCalendar(
```dart {4}
FCalendar(
controller: FCalendarController.dates(
initialSelections: {DateTime.utc(2024, 7, 17), DateTime.utc(2024, 7, 20)},
selectable: (date) => !{DateTime.utc(2024, 7, 18), DateTime.utc(2024, 7, 19)}.contains(date),
initialSelections: {DateTime(2024, 7, 17), DateTime(2024, 7, 20)},
selectable: (date) => !{DateTime(2024, 7, 18), DateTime(2024, 7, 19)}.contains(date),
),
start: DateTime.utc(2000),
today: DateTime.utc(2024, 7, 15),
end: DateTime.utc(2030),
start: DateTime(2000),
today: DateTime(2024, 7, 15),
end: DateTime(2030),
);
```
</Tabs.Tab>
Expand All @@ -118,11 +122,11 @@ FCalendar(
```dart {2-4}
FCalendar(
controller: FCalendarController.range(
initialSelection: (DateTime.utc(2024, 7, 17), DateTime.utc(2024, 7, 20)),
initialSelection: (DateTime(2024, 7, 17), DateTime(2024, 7, 20)),
),
start: DateTime.utc(2000),
today: DateTime.utc(2024, 7, 15),
end: DateTime.utc(2030),
start: DateTime(2000),
today: DateTime(2024, 7, 15),
end: DateTime(2030),
);
```
</Tabs.Tab>
Expand Down
Loading

0 comments on commit 24321ff

Please sign in to comment.