Enumeration of date/time format presets used throughout ProjectForge's UI and export layers. Defines 16 distinct format levels from simple date-only (DATE_WITHOUT_YEAR) to full ISO 8601 timestamps (ISO_TIMESTAMP_MILLIS). Serves as a declarative format catalog — actual format pattern strings are resolved at runtime by DateHelper or the user's locale settings, enabling locale-aware date formatting without hardcoded pattern strings.
Format Categories
Date-Only Formats
| Enum Constant | Example Pattern | Use Case |
DATE_WITHOUT_YEAR | dd.MM. / MM/dd / dd/MM | Birthdays displayed without year, day-month lists |
DATE | dd.MM.yyyy / MM/dd/yyyy | General date display, form date fields |
DATE_WITH_DAY_NAME | E, dd.MM.yyyy | Calendar views, scheduling pages showing day of week |
DATE_SHORT | dd.MM.yy / MM/dd/yy | Excel exports, compact list views |
ISO_DATE | yyyy-MM-dd | Database queries, API responses, data interchange |
Date-Time Formats
| Enum Constant | Precision | Use Case |
DATE_TIME_SHORT_SECONDS | DATE_SHORT + HH:mm:ss | Compact logs, audit trail entries |
DATE_TIME_SHORT_MINUTES | DATE_SHORT + HH:mm | Calendar event times, meeting schedules |
DATE_TIME_MILLIS | DATE + HH:mm:ss.SSS | Precise timestamps with milliseconds |
DATE_TIME_SECONDS | DATE + HH:mm:ss | General timestamp display, audit logs |
DATE_TIME_MINUTES | DATE + HH:mm | Timesheet entries, project time tracking |
Time-Only Formats
| Enum Constant | Pattern | Use Case |
TIME_OF_DAY_SECONDS | HH:mm:ss | Duration displays, stopwatch-style views |
TIME_OF_DAY_MINUTES | HH:mm | Time inputs, meeting times, opening hours |
ISO 8601 Timestamp Formats
| Enum Constant | Pattern | Use Case |
ISO_TIMESTAMP_MILLIS | yyyy-MM-dd HH:mm:ss.SSS | High-precision logging, database audit columns |
ISO_TIMESTAMP_SECONDS | yyyy-MM-dd HH:mm:ss | API responses, JSON serialization, REST endpoints |
ISO_TIMESTAMP_MINUTES | yyyy-MM-dd HH:mm | Calendar export (iCal), scheduling systems |
Special Format
| Enum Constant | Pattern | Use Case |
DAY_OF_WEEK_SHORT | EE (Mon, Tue, ...) | Week headers in calendar views, timesheet week overview |
Locale Awareness
The Javadoc comments for DATE and DATE_WITHOUT_YEAR show multiple pattern examples ("dd.MM.", "MM/dd", "dd/MM"), indicating these enum constants represent format intent rather than fixed patterns. The actual pattern string is resolved by DateHelper based on the user's locale:
- German locale →
dd.MM.yyyy
- US locale →
MM/dd/yyyy
- UK locale →
dd/MM/yyyy
This is a critical design feature for ProjectForge's international user base.
Excel Export Notation
The DATE_SHORT constant's Javadoc includes Excel-specific notation: "DD.MM.YY", "MM/DD/YY", "DD/MM/YY". This suggests the DateFormatType constants are also used by the Excel export module (org.projectforge.business.excel) which maps these enum values to Excel cell format strings — different from Java's SimpleDateFormat patterns (month is MM in Excel vs MM in Java, but uppercase differences exist).
Relationship with DateHelper
While this file only defines the enum constants, the actual format resolution logic resides in DateHelper (in the same package). DateHelper likely contains a getFormat(DateFormatType, Locale) or similar method that maps each enum constant to a locale-specific DateFormat or SimpleDateFormat instance.
Design Pattern: Enum as Declarative Catalog
This enum follows a pattern where the enum serves as a declarative catalog of available options, while the actual behavior is implemented elsewhere (DateHelper). This separation allows:
- UI components to offer a dropdown list of all available formats (enum iteration)
- Business logic to reference formats by semantic name rather than pattern string
- Centralized locale resolution in DateHelper without duplicating format logic in the enum
- Serialization of format preferences (e.g., user's preferred date format stored as enum name in database)
The ISO timestamp formats use a space separator (yyyy-MM-dd HH:mm:ss) rather than the ISO 8601 standard T separator (yyyy-MM-ddTHH:mm:ss). While common in database and display contexts, this is technically not strict ISO 8601. The format names suggest ISO compliance but the actual patterns are "ISO-like."
The 16 format constants cover a comprehensive range from "no year" to "millisecond precision." This granularity reflects ProjectForge's diverse use cases: timesheet management (minutes precision), financial reports (day precision), audit trails (millisecond precision), calendar views (day-of-week), and database migration tracking (ISO timestamps). Each format serves a specific UX or data requirement.