Announcement Announcement Module
Collapse
No announcement yet.
Issue with Date Format Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Issue with Date Format

    In the create view, when I submit the form, I get each time an error message on date format:
    HTML Code:
    Meeting cannot be submitted due to errors below
        Property meetingDate must be a valid Date
    I don't even reach the save method from the controller ...
    However, I don't see anything wrong in my code. What is the default date format ? How to pass this validation ?

    View (Create.gsp)
    Code:
    <g:uploadForm name="submitMeeting" action="save" controller="meeting" >
    <table class="simpletable">
    	<tr>
    		<td>When</td>
    		<td> 
    			<input type="text" id="meetingDate" name="meetingDate" maxlength="20" size="20" 
    				value="<g:formatDate format='dd-MM-yyyy hh:mm:ss' date='${meetingInstance.meetingDate}' />" />
    		</td>

    Domain
    Code:
    class Meeting {
    
    	Date 		meetingDate;
    	String 		place;
    	String 		agenda;
    	String 		presenter;
    	String  	extension;
    	String  	filename;
    	MiniwebUser sender;
    	Float		duration;
    		
        static constraints = {
    		meetingDate		blank: false, date:true
    		place     		blank: false, size:5..75
    		agenda    		blank: false, size:5..500
    		presenter 		nullable: true, size:0..100
    		extension 		nullable: true
    		filename 		nullable: true
    		sender 			nullable: false
    		duration		blank: false
        }
    	
    	
    }

    Any help is appreciated ...
Working...
X