(userTimeFormat: "12" | "24")
| 989 | * Use this in UI components that have access to the plugin instance |
| 990 | */ |
| 991 | export function createTimeFormatHelper(userTimeFormat: "12" | "24") { |
| 992 | return { |
| 993 | formatDateTimeForDisplay: ( |
| 994 | dateString: string, |
| 995 | options: { |
| 996 | dateFormat?: string; |
| 997 | timeFormat?: string; |
| 998 | showTime?: boolean; |
| 999 | } = {} |
| 1000 | ) => formatDateTimeForDisplay(dateString, { ...options, userTimeFormat }), |
| 1001 | |
| 1002 | formatTime: (date: Date) => formatTime(date, userTimeFormat), |
| 1003 | |
| 1004 | formatDateTime: (date: Date) => formatDateTime(date, userTimeFormat), |
| 1005 | |
| 1006 | formatDateStringTime: (dateString: string) => |
| 1007 | formatDateStringTime(dateString, userTimeFormat), |
| 1008 | }; |
| 1009 | } |
| 1010 | |
| 1011 | /** |
| 1012 | * Combine a date and time into a datetime string |
nothing calls this directly
no test coverage detected