Fixes: #16872 ## Summary Fixes the DateTimePicker to respect user's 12H/24H time format preference. Previously, the time display at the top of the DateTimePicker always showed 24-hour format (e.g., "14:30") regardless of the user's time format setting. ## Screenshots _After:_ Time respects user preference, showing 12H with AM/PM (e.g., "03:28 PM") or 24H format <img width="357" height="491" alt="image" src="https://github.com/user-attachments/assets/4a03f195-a52b-4f74-84ba-c5eb2fc6c8c1" /> ## Implementation Details ### Changes Made: 1. **TimeMask.ts** - Added `getTimeMask()` to return appropriate mask pattern based on time format 2. **TimeBlocks.ts** - Restored as constant file per linting requirements 3. **getTimeBlocks.ts** (new) - Dynamic block generator supporting 12H (1-12 + AM/PM) and 24H (0-23) 4. **DateTimeBlocks.ts** - Simplified to static constant 5. **getDateTimeMask.ts** - Updated to accept and use `timeFormat` parameter 6. **DateTimePickerInput.tsx** - Dynamically generates mask and blocks based on user's time format preference, increased input width to accommodate AM/PM 7. **useParseJSDateToIMaskDateTimeInputString.ts** - Formats dates with correct time pattern 8. **useParseDateTimeInputStringToJSDate.ts** - Parses dates with correct time pattern 9. **date-utils.ts** - Added `getTimePattern()` helper (returns 'hh:mm a' for 12H, 'HH:mm' for 24H) 10. **parseDateTimeToString.ts** - Added optional `timeFormat` parameter for consistency ### Technical Approach: - Leverages existing `useDateTimeFormat()` hook to get user's `timeFormat` preference - Supports `TimeFormat.SYSTEM`, `TimeFormat.HOUR_12`, and `TimeFormat.HOUR_24` - Uses IMask blocks with appropriate ranges: 1-12 for 12H, 0-23 for 24H - Adds 'aa' (AM/PM) block for 12-hour format with enum validation --------- Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
The #1 Open-Source CRM
🌐 Website · 📚 Documentation · Roadmap ·
Discord ·
Figma
Installation
See: 🚀 Self-hosting 🖥️ Local Setup
Does the world need another CRM?
We built Twenty for three reasons:
CRMs are too expensive, and users are trapped. Companies use locked-in customer data to hike prices. It shouldn't be that way.
A fresh start is required to build a better experience. We can learn from past mistakes and craft a cohesive experience inspired by new UX patterns from tools like Notion, Airtable or Linear.
We believe in Open-source and community. Hundreds of developers are already building Twenty together. Once we have plugin capabilities, a whole ecosystem will grow around it.
What You Can Do With Twenty
Please feel free to flag any specific needs you have by creating an issue.
Below are a few features we have implemented to date:
- Personalize layouts with filters, sort, group by, kanban and table views
- Customize your objects and fields
- Create and manage permissions with custom roles
- Automate workflow with triggers and actions
- Emails, calendar events, files, and more
Personalize layouts with filters, sort, group by, kanban and table views
Customize your objects and fields
Create and manage permissions with custom roles
Automate workflow with triggers and actions
Emails, calendar events, files, and more
Stack
- TypeScript
- Nx
- NestJS, with BullMQ, PostgreSQL, Redis
- React, with Recoil, Emotion and Lingui
Thanks
Thanks to these amazing services that we use and recommend for UI testing (Chromatic), code review (Greptile), catching bugs (Sentry) and translating (Crowdin).
Join the Community
- Star the repo
- Subscribe to releases (watch -> custom -> releases)
- Follow us on Twitter or LinkedIn
- Join our Discord
- Improve translations on Crowdin
- Contributions are, of course, most welcome!




