开发者

Date Error in jquery

I have written the below code in the edit view (gsp page)

View

$(document).ready(function(){
  $("[name=licenseIssueDate]").datepicker({ dateFormat: 'dd-mm-yy', changeYear: true});
  $("[name=licenseExpirtyDate]").datepicker({ dateFormat: 'dd-mm-yy', changeYear: true});
}

<g:textField name="licenseExpirtyDate" value="${driverRoleInstance?.licenseExpirtyDate}" id ="licenseExpirtyDate" /> <g:textField name="licenseIssueDate" value="${driverRoleInstance?.licenseIssueDate}" id= "licenseIssueDate" />

Controller :

In the controller i am paring the 开发者_如何学Cdate and verifying for the uniqueness of licensenumber

params.licenseIssueDate = params.licenseIssueDate?Date.parse("dd-MM-yyyy", params.licenseIssueDate):null
params.licenseExpirtyDate = params.licenseExpirtyDate?Date.parse("dd-MM-yyyy", params.licenseExpirtyDate):null  

if(licenseNumberLists.contains(params.licenseNumber)){
  println "update :: duplicate Chauffeur"
  flash.message = "Chauffeur already exists";
  render(view: "edit", model: [driverRoleInstance:driverRoleInstance])
}

If the chauffeur already exists it prints a message and after that License issued and Expired fields are getiing filled with value "undefined-undefined-Tue Aug 16" .so what is the problem in this.and how to solve this

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜