katemihalikova / ion-datetime-picker

Date and/or time picker for awesome Ionic framework
MIT License
168 stars 101 forks source link

Save problem #15

Closed MessaoudMohamed closed 8 years ago

MessaoudMohamed commented 8 years ago

http://localhost:2480/function/Insta/createEvent/12:6/ddd/ddd/Thu%20Apr%2021%202016%2018:03:00%20GMT+0100%20(Paris,%20Madrid) 500 (Internal Server Error)

and all whta i want to have is : 2016-04-09 00:55:00 how can i do it or fix it please? thank you

katemihalikova commented 8 years ago

Use $scope.modelValue.toISOString() or similar.

MessaoudMohamed commented 8 years ago

can not read the property .toISOString() and when and without it i have this error POST http://_/_/Insta/createEvent/12:6/dddd/ddd/**Wed%20Apr%2013%202016%2010:34:00%20GMT+0100%20(Paris,%20Madrid**) 500 (Internal Server Error) the problem that he should pass 20/04/2016 .........

katemihalikova commented 8 years ago

Seems like your problem lies in your app, not in this component.

$scope.modelValue = new Date();
// modifying with the picker
$scope.modelValue instanceof Date === true
"http://Insta/createEvent/12:6/dddd/ddd/" + $scope.modelValue === "http://Insta/createEvent/12:6/dddd/ddd/Wed Apr 13 2016 10:34:00 GMT+0100 (Paris, Madrid)"
"http://Insta/createEvent/12:6/dddd/ddd/" + $scope.modelValue.toISOString() === "http://Insta/createEvent/12:6/dddd/ddd/2016-04-13T09:34:00.000Z"

Modify it to fit your needs. Sorry for the lack of more help, but this issue is not a place for learning you the basics of javascript.

MessaoudMohamed commented 8 years ago

POST http://Insta/createEvent/12:6/ddd/dddd/2016-04-08**T**09:56:41*_.138Z *_ how can i take of .138Z and change T with a space thankyou for your help

katemihalikova commented 8 years ago
$scope.modelValue.toISOString().replace("T", " ").replace(/\.[0-9]{3}Z$/, "");
MessaoudMohamed commented 8 years ago

Thank you very much