mirror of
				https://github.com/grocy/grocy.git
				synced 2025-10-31 02:36:54 +00:00 
			
		
		
		
	Validate that best before date is min. today
This commit is contained in:
		| @@ -187,6 +187,13 @@ $(function() | ||||
| 				{ | ||||
| 					return 'Wrong date format, needs to be YYYY-MM-DD'; | ||||
| 				} | ||||
| 				else if (moment($el.val()).isValid()) | ||||
| 				{ | ||||
| 					if (moment($el.val()).isBefore(moment(), 'day')) | ||||
| 					{ | ||||
| 						return 'This value cannot be before today.'; | ||||
| 					} | ||||
| 				} | ||||
| 			}, | ||||
| 			'notequal': function($el) | ||||
| 			{ | ||||
|   | ||||
| @@ -192,6 +192,13 @@ $(function() | ||||
| 				{ | ||||
| 					return 'Wrong date format, needs to be YYYY-MM-DD'; | ||||
| 				} | ||||
| 				else if (moment($el.val()).isValid()) | ||||
| 				{ | ||||
| 					if (moment($el.val()).isBefore(moment(), 'day')) | ||||
| 					{ | ||||
| 						return 'This value cannot be before today.'; | ||||
| 					} | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 	}); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user