Quantcast
Channel: Spring Community Forums - Grails
Viewing all articles
Browse latest Browse all 40

Issue with Date Format

$
0
0
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 ...

Viewing all articles
Browse latest Browse all 40

Trending Articles