javascript - How to set right date format for editable-date -



javascript - How to set right date format for editable-date -

i getting date fileds postgres format like:

"2000-11-30t14:00:00.000z"

i can't utilize in editable-date field on page. like:

<a href="#" editable-date="employee.brthday" onbeforesave="updatefield($data, 'brthday', employee)"> {{employee.brthday || 'empty' | date:"dd/mm/yyyy" }} </a>

this date (like above) displayed fine. when want edit field, date reset , got message in console:

error: [ngmodel:datefmt] expected `2000-12-05t14:00:00.000z` date http://errors.angularjs.org/1.3.0/ngmodel/datefmt?p0=2000-12-05t14%3a00%3a00.000z @ http://localhost:8000/bower_components/angular/angular.js:80:12 @ array.<anonymous> (http://localhost:8000/bower_components/angular/angular.js:19453:17) @ object.ngmodelwatch (http://localhost:8000/bower_components/angular/angular.js:20555:36) @ scope.$digest (http://localhost:8000/bower_components/angular/angular.js:13957:40) @ scope.$apply (http://localhost:8000/bower_components/angular/angular.js:14227:24) @ htmlanchorelement.<anonymous> (http://localhost:8000/bower_components/angular-xeditable/dist/js/xeditable.js:831:21) @ htmlanchorelement.jquery.event.dispatch (http://localhost:8000/bower_components/jquery/dist/jquery.js:4409:9) @ htmlanchorelement.elemdata.handle (http://localhost:8000/bower_components/jquery/dist/jquery.js:4095:28)

if update model editing field (input new date), edit fine in future, because date stored (date obj?):

wed dec 06 2000 00:00:00 gmt+1000 (Якутское время (зима))

how can convert input date, understandable angular format? tried replace input date format 'new date(input-date-here), doesn't work. may input date format can't parsed string? summarizing: need convert input date format date obj or via pg.js date fields date objects. how can that?

postgres storing dates in iso 8601 format, javascript date can parse out of box, example:

var x = new date("2000-11-30t14:00:00.000z"); console.log(x);

results in thu nov 30 2000 06:00:00 gmt-0800 (pst) right time zone.

javascript angularjs date x-editable node-postgres

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -