Skip to content

Commit

Permalink
fix: Datetime-input is formatted with / instead of : (#3450)
Browse files Browse the repository at this point in the history
I forgot to account for literals/placeholder-values, so it acts a bit... off now.
  • Loading branch information
yusijs committed May 21, 2024
1 parent 9190f32 commit 5a5aa68
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ export function DateSegment({
? formatter.formatToParts(state.value.toDate(timezone))
: []
const part = parts.find((p) => p.type === segment.type)
const value = part?.value ?? segment.text
const value =
segment.isPlaceholder || segment.type === 'literal'
? segment.text
: part?.value ?? segment.text

const [focus, setFocus] = useState(false)
const ref = useRef(null)
Expand Down

0 comments on commit 5a5aa68

Please sign in to comment.