Prerequisites
Affected component
No response
Summary
When a time with hours equal to 12 (noon) is written to the SiTimepickerComponent — for example 12:30 PM — the meridian <select> incorrectly displays AM instead of PM.
Version
@siemens/element-ng@48.11.0
Steps to reproduce
- Use SiTimepickerComponent with a 12-hour clock locale or showMeridian="true".
- Set the control value to any time between 12:00 and 12:59 in 24-hour format (i.e. noon through 12:59 PM).
- Observe the meridian
<select>.
What is the current bug behavior
In updateUI(), the condition used to determine the meridian from a 24-hour hours value was off-by-one:
// Before (wrong) — noon (hours === 12) evaluates to false → 'am'
this.meridian.set(hours > 12 ? 'pm' : 'am');
What is the expected correct behavior
| 24h hours |
12h display |
Expected meridian |
| 0 |
12:00 AM (midnight) |
AM |
| 1–11 |
1–11 AM |
AM |
| 12 |
12:00 PM (noon) |
PM |
| 13–23 |
1–11 PM |
PM |
// After (correct) — noon (hours === 12) evaluates to true → 'pm'
this.meridian.set(hours >= 12 ? 'pm' : 'am');
Prerequisites
Affected component
No response
Summary
When a time with hours equal to 12 (noon) is written to the SiTimepickerComponent — for example 12:30 PM — the meridian
<select>incorrectly displays AM instead of PM.Version
@siemens/element-ng@48.11.0Steps to reproduce
<select>.What is the current bug behavior
In
updateUI(), the condition used to determine the meridian from a 24-hour hours value was off-by-one:What is the expected correct behavior