You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			18 lines
		
	
	
		
			535 B
		
	
	
	
		
			Dart
		
	
			
		
		
	
	
			18 lines
		
	
	
		
			535 B
		
	
	
	
		
			Dart
		
	
import 'package:intl/intl.dart';
 | 
						|
 | 
						|
extension StringExtensions on String {
 | 
						|
  String get toServiceRequestCardFormat {
 | 
						|
    DateTime dateTime = DateTime.tryParse(this);
 | 
						|
    return "${DateFormat('dd MMM, yyyy').format(dateTime)}\n${DateFormat('hh:mm a').format(dateTime)}";
 | 
						|
  }
 | 
						|
 | 
						|
  String get toServiceRequestDetailsFormat {
 | 
						|
    try {
 | 
						|
      DateTime dateTime = DateTime.tryParse(this);
 | 
						|
      return "${DateFormat('dd MMM, yyyy').format(dateTime)} ${DateFormat('hh:mm a').format(dateTime)}";
 | 
						|
    } catch (e) {
 | 
						|
      return "null";
 | 
						|
    }
 | 
						|
  }
 | 
						|
}
 |