Package com.example.breeze_seas
Class EventMetadataUtils
java.lang.Object
com.example.breeze_seas.EventMetadataUtils
Shared helpers for formatting and converting event date-time metadata.
-
Method Summary
Modifier and TypeMethodDescriptionstatic longcombineUtcDateWithLocalTime(long utcDateMillis, int hourOfDay, int minute) Combines a MaterialDatePicker UTC date selection with a local time selection.static StringformatDateTime(com.google.firebase.Timestamp timestamp) Formats a Firestore timestamp for organizer and entrant-facing date-time displays.static StringformatDateTime(Long millis) Formats epoch milliseconds for organizer and entrant-facing date-time displays.static longtoDatePickerSelection(Long currentMillis) Converts a locally stored timestamp into the UTC midnight value expected by MaterialDatePicker.
-
Method Details
-
formatDateTime
Formats a Firestore timestamp for organizer and entrant-facing date-time displays.- Parameters:
timestamp- Timestamp to format.- Returns:
- Display-ready date-time string, or
"Not set"when absent.
-
formatDateTime
Formats epoch milliseconds for organizer and entrant-facing date-time displays.- Parameters:
millis- Epoch milliseconds to format.- Returns:
- Display-ready date-time string, or
"Not set"when absent.
-
toDatePickerSelection
Converts a locally stored timestamp into the UTC midnight value expected by MaterialDatePicker.- Parameters:
currentMillis- Existing local timestamp, ornull.- Returns:
- UTC midnight millis for the selected date.
-
combineUtcDateWithLocalTime
public static long combineUtcDateWithLocalTime(long utcDateMillis, int hourOfDay, int minute) Combines a MaterialDatePicker UTC date selection with a local time selection.- Parameters:
utcDateMillis- UTC midnight millis returned by MaterialDatePicker.hourOfDay- Selected local hour.minute- Selected local minute.- Returns:
- Local timestamp that preserves the chosen calendar date and time.
-