mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 04:37:32 -04:00 
			
		
		
		
	Catch possible invalid format exception & return "Invalid date!"
This commit is contained in:
		
							parent
							
								
									7c01b3bb64
								
							
						
					
					
						commit
						b88533d3d2
					
				| @ -99,10 +99,13 @@ trait MakesDates | ||||
| 
 | ||||
|     public function translateDate($date, $format, $locale) | ||||
|     { | ||||
|          | ||||
|         Carbon::setLocale($locale); | ||||
|         return Carbon::parse($date)->translatedFormat($format); | ||||
| 
 | ||||
|         try { | ||||
|             return Carbon::parse($date)->translatedFormat($format); | ||||
|         } catch(\Exception $e) { | ||||
|             return 'Invalid date!'; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| } | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user