lightning-base-components 1.14.3-alpha → 1.14.4-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -45,11 +45,11 @@ are specified, the component uses the default date format based on the user's lo
45
45
 
46
46
  The locale determines the order and format of the month, day, and year. For example, the English (United States) locale's date format is Oct 14, 2020 and the French (France) locale's date format is 14 Oct 2020. The locale doesn't determine the time zone. Time zone is a separate setting.
47
47
 
48
- The locale also determines whether to display time as 24-hour time or 12-hour time with AM and PM.
48
+ The locale also determines whether to display time as 24-hour time or 12-hour time with AM and PM. You can override the locale default with the `hour12` attribute. See _Date and Time Display Examples_ for more information.
49
49
 
50
- Specify optional attributes to modify the date and time display, overriding the locale's default formatting.
50
+ Specify optional attributes listed in the Specification tab to modify the date and time display, overriding the locale's default formatting.
51
51
 
52
- In the Component Library's Playground and the Mini-Playground in the Examples tab, the component is limited to the en-US locale.
52
+ In the Mini-Playground in the Examples tab, the component is limited to the en-US locale.
53
53
 
54
54
  #### Time Zone Considerations
55
55
 
@@ -132,6 +132,35 @@ Displays: 1/11/2019, 6:53 PM EST
132
132
  </template>
133
133
  ```
134
134
 
135
+ Displays: 1/11/2019, 18:53 EST
136
+
137
+ ```html
138
+ <template>
139
+ <lightning-formatted-date-time
140
+ value="1547250828000"
141
+ year="numeric"
142
+ month="numeric"
143
+ day="numeric"
144
+ hour="2-digit"
145
+ hour12={ampm}
146
+ minute="2-digit"
147
+ time-zone-name="short"
148
+ time-zone="America/New_York"
149
+ >
150
+ </lightning-formatted-date-time>
151
+ </template>
152
+ ```
153
+
154
+ Set the `hour12` attribute using a variable. If set to `false` or any other string directly, the component interprets its value as true.
155
+
156
+ ```js
157
+ import { LightningElement } from 'lwc';
158
+
159
+ export default class FormattedDateTimeHour12 extends LightningElement {
160
+ ampm = false;
161
+ }
162
+ ```
163
+
135
164
  #### Date and Time Stored in Salesforce
136
165
 
137
166
  Salesforce uses the ISO8601 format `YYYY-MM-DD` to store date fields, which store a date without time, and includes no time zone information.
@@ -186,6 +215,10 @@ Displays: December 03, 2017, 12:00 PM
186
215
  </template>
187
216
  ```
188
217
 
218
+ #### Usage Considerations
219
+
220
+ This component has usage differences from its Aura counterpart. See [Base Components: Aura Vs Lightning Web Components](docs/component-library/documentation/lwc/lwc.migrate_map_aura_lwc_components) in the Lightning Web Components Developer Guide.
221
+
189
222
  #### Source Code
190
223
 
191
224
  `lightning-formatted-date-time` is available in the [Base Components Recipes GitHub repository](https://github.com/salesforce/base-components-recipes#documentation). It's transpiled into the `c` namespace so that you can use it in your own projects.
@@ -4,8 +4,8 @@
4
4
  <p><lightning-formatted-date-time value="1547250828000" year="2-digit" month="short" day="2-digit" hour="numeric"
5
5
  weekday="long" era="short"></lightning-formatted-date-time></p>
6
6
  <p><lightning-formatted-date-time value="1547250828000" year="numeric" month="numeric" day="numeric" hour="2-digit"
7
- minute="2-digit" time-zone-name="short" hour12="true"></lightning-formatted-date-time></p>
7
+ minute="2-digit" time-zone-name="short"></lightning-formatted-date-time></p>
8
8
  <p><lightning-formatted-date-time value="1547250828000" year="numeric" month="numeric" day="numeric" hour="2-digit"
9
- minute="2-digit" time-zone="UTC" time-zone-name="short" hour12="false"></lightning-formatted-date-time></p>
9
+ minute="2-digit" time-zone="UTC" time-zone-name="short" hour12={ampm}></lightning-formatted-date-time></p>
10
10
  </div>
11
11
  </template>
@@ -1,3 +1,5 @@
1
1
  import { LightningElement } from 'lwc';
2
2
 
3
- export default class FormattedDateTimeDateTime extends LightningElement {}
3
+ export default class FormattedDateTimeDateTime extends LightningElement {
4
+ ampm = false;
5
+ }
@@ -5,7 +5,7 @@
5
5
  <p><lightning-formatted-date-time value="1547250828000" hour="2-digit" second="2-digit"></lightning-formatted-date-time></p>
6
6
  <p><lightning-formatted-date-time value="1547250828000" hour="2-digit" minute="2-digit" time-zone="UTC"
7
7
  time-zone-name="short"></lightning-formatted-date-time></p>
8
- <p><lightning-formatted-date-time value="1547250828000" hour="2-digit" minute="2-digit" second="2-digit" hour12="false"
8
+ <p><lightning-formatted-date-time value="1547250828000" hour="2-digit" minute="2-digit" second="2-digit" hour12={ampm}
9
9
  time-zone-name="long"></lightning-formatted-date-time></p>
10
10
  </div>
11
11
  </template>
@@ -1,3 +1,5 @@
1
1
  import { LightningElement } from 'lwc';
2
2
 
3
- export default class FormattedDateTimeTime extends LightningElement {}
3
+ export default class FormattedDateTimeTime extends LightningElement {
4
+ ampm = false;
5
+ }
@@ -92,6 +92,7 @@ export default class LightningFormattedDateTime extends LightningElement {
92
92
 
93
93
  /**
94
94
  * Determines whether time is displayed as 12-hour. If false, time displays as 24-hour. The default setting is determined by the user's locale.
95
+ * Set the value using a variable. If set to any string directly, the component interprets its value as true.
95
96
  * @type {boolean}
96
97
  *
97
98
  */
@@ -202,7 +202,6 @@
202
202
  </div>
203
203
  </template>
204
204
 
205
-
206
205
  <template if:true={isTypeColor}>
207
206
  <div class="slds-color-picker">
208
207
  <div class="slds-form-element slds-color-picker__summary">
@@ -213,6 +212,7 @@
213
212
  </template>
214
213
  {label}
215
214
  </label>
215
+ <lightning-helptext if:true={fieldLevelHelp} content={fieldLevelHelp} alternative-text={helptextAlternativeText}></lightning-helptext>
216
216
  </template>
217
217
  <div class="slds-form-element__control">
218
218
  <lightning-primitive-colorpicker-button
@@ -239,9 +239,6 @@
239
239
  oninput={handleInput}>
240
240
  </div>
241
241
  </div>
242
- <template if:false={hasExternalLabel}>
243
- <lightning-helptext if:true={fieldLevelHelp} content={fieldLevelHelp} alternative-text={helptextAlternativeText}></lightning-helptext>
244
- </template>
245
242
  </div>
246
243
  </div>
247
244
  </template>
@@ -1 +0,0 @@
1
- export default 'Close';