Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PBIOS-442] Date Time Stacked Docs #3486

Merged
merged 3 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
![Date-Time-Stacked-Default](https://github.com/powerhome/playbook/assets/54749071/b877dd01-32fa-49ff-af2d-1f8d819f6f39)

```swift
VStack(alignment: .leading, spacing: Spacing.small) {
PBDateTimeStacked(
timeZoneIdentifier: "EDT",
isLowercase: true,
isMonthStacked: true,
isMonthBold: true
)
PBDateTimeStacked(
timeZoneIdentifier: "EDT",
isYearDisplayed: true,
isLowercase: true,
isMonthStacked: true,
isMonthBold: true,
isYearBold: true,
dateVariant: .standard
)
PBDateTimeStacked(
timeZoneIdentifier: "GMT+9",
isLowercase: true,
isMonthStacked: true,
isMonthBold: true
)
PBDateTimeStacked(
timeZoneIdentifier: "MDT",
isLowercase: true,
isMonthStacked: true,
isMonthBold: true
)
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
### Props
| Name | Type | Description | Default | Values |
| --- | ----------- | --------- | --------- | --------- |
| **dateTime** | `Date` | Takes a date type to calculate the current date | `Date()` | |
| **timeDate** | `Date` | Takes a date type to calculate the current time | `Date()` | |
| **timeZoneIdentifier** | `String` | A string value that is used in a function to get the correct time in the corrresponding time zone. This value is also used to display the time zone next to the time | | |
| **isYearDisplayed** | `Bool` | Determines whether or not the year is displayed with the month and day | `false` | `true` `false` |
| **isLowercase** | `Bool` | Determines whether or not am/pm is capitalized | `false` | `true` `false` |
| **isMonthStacked** | `Bool` | Determines whether or not the value for month is stacked over the date | `false` | `true` `false` |
| **isMonthBold** | `Bool` | Determines whether or not the month is in bold | `false` | `true` `false` |
| **isYearBold** | `Bool` | Determines whether or not the year is in bold | `false` | `true` `false` |
| **dateAlignment** | `HorizontalAlignment` | Sets alignment of date | `.trailing` | `leading` `center` `trailing` |
| **timeAlignment** | `HorizontalAlignment` | Sets alignment of the time zone | `.leading` | `leading` `center` `trailing` |
| **dateVariant** | `Variant` | Allows user to choose the style in which the date is displayed | `.short(showIcon: false)` | `.short(showIcon: false)` `.dayDate(showYear: false)` `.standard` ` .withIcon(isStandard: true)` `.withIcon(isStandard: false)` |
| **timeVariant** | `Variant` | Allows user to choose the style in which the time is displayed | `.time` | `.time` `.iconTimeZone` `.withTimeZoneHeader` |
| **dateSize** | `String` | Allows user to choose the size of the date that is being displayed | `.title4` | `title4` `body` `caption` `large` `subcaption` |
| **timeStyle** | `PBFont` | Allows user to choose the size of the time that is being displayed | `.caption` | `body` `caption` `large` `subcaption`|
| **timeZoneStyle** | `PBFont` | Allows user to choose the size of the time zone that is being displayed | `.caption` | `body` `caption` `large` `subcaption`|
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ examples:

rails:
- date_time_stacked_default: Default

react:
- date_time_stacked_default: Default

swift:
- date_time_stacked_default_swift: Default
- date_time_stacked_props_swift: ""

Loading