Skip to content

Commit

Permalink
update picker
Browse files Browse the repository at this point in the history
  • Loading branch information
severinlandolt committed Apr 15, 2024
1 parent 79405b1 commit 9716195
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
14 changes: 12 additions & 2 deletions src/components/DatePicker/DatePicker.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Tremor Raw Date Picker [v0.0.1]
// Tremor Raw Date Picker [v1.0.0]

"use client"

Expand All @@ -25,7 +25,6 @@ import { cx } from "../../utils/cx"
import { focusInput } from "../../utils/focusInput"
import { focusRing } from "../../utils/focusRing"
import { hasErrorInput } from "../../utils/hasErrorInput"
import { isBrowserLocaleClockType24h } from "../../utils/isBrowserLocaleClockType24h"
import { Button } from "../Button/Button"
import {
Calendar as CalendarPrimitive,
Expand All @@ -35,6 +34,17 @@ import {
//#region TimeInput
// ============================================================================

const isBrowserLocaleClockType24h = () => {
const language =
typeof window !== "undefined" ? window.navigator.language : "en-US"

const hr = new Intl.DateTimeFormat(language, {
hour: "numeric",
}).format()

return Number.isInteger(Number(hr))
}

type TimeSegmentProps = {
segment: DateSegment
state: DateFieldState
Expand Down
2 changes: 1 addition & 1 deletion src/components/DatePicker/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tremor Raw Date Picker Changelog

## 0.2.0
## 1.0.0

### Changes

Expand Down
10 changes: 0 additions & 10 deletions src/utils/isBrowserLocaleClockType24h.ts

This file was deleted.

0 comments on commit 9716195

Please sign in to comment.