// srv/utils/strings.js

export function formatTime(time) {
  const [hours, minutes] = time.split(':');
  return `${hours}:${minutes}`;
}

export function formatDate(date) {
  const options = { year: 'numeric', month: '2-digit', day: '2-digit' };
  return new Date(date).toLocaleDateString('de-DE', options);
}

export function formatTimeFromDate(dateString) {
  const date = new Date(dateString);
  const hours = String(date.getHours()).padStart(2, '0');
  const minutes = String(date.getMinutes()).padStart(2, '0');
  return `${hours}:${minutes}`;
}

