import 'package:intl/intl.dart';

extension DateTimeReadableFormat1 on DateTime {
  // Convert DateTime to the format "12 Feb, 2025 at 12:30pm"
  String toReadableFormat1() {
    final DateFormat formatter = DateFormat("d MMM, yyyy 'at' h:mma");
    return formatter.format(this);
  }
}

extension DateTimeReadableFormat2 on DateTime {
  // Convert DateTime to the format "2025-02-12 12:30:00"
  String toReadableFormat2() {
    final DateFormat formatter = DateFormat("yyyy-MM-dd HH:mm:ss");
    return formatter.format(this);
  }
}

extension DateTimeExtension on String {
  DateTime toDateTime() {
    // Parse the string using the DateTime.parse method
    return DateTime.parse(this);
  }
}
