AmirkabirDataMiners / ADM-dateTimePicker

Pure AngularJs dateTimePicker
http://amirkabirdataminers.github.io/ADM-dateTimePicker
MIT License
244 stars 93 forks source link

ng-model returning formatted date, could we have option to have it back as javascript date format #18

Open newargus opened 8 years ago

newargus commented 8 years ago

Hi again,

I've try to initiate the ng-model with a javascript english datetime format and it is working as expected (format it as option chosen dd/mm/yyyy for french date), but when I get it back from ng-model variable, it return it as formatted option and not to regular english date time. It could be nice feature sometimes but I would have expected to have an option to force retrun in regular date format.

I know the full-date option could do the job, but you have then to handle it in the form submit code.

MeTe-30 commented 8 years ago

Hi again :) Yes, I also thought that. But i'm getting stuck on how to implement that:

  1. Option to set gDate instead of formatted date. (type: Date)
  2. Option to set ngModel format. (combination of YY,MM,DD ..., type: String)
shaporty commented 8 years ago

hi there the second option is better .

newargus commented 8 years ago

The 2 solutions can be useful of course, but i would say that it should preserve format given by ngmodel. If you initiate it with a date, return should be the same. Options should be used to force different behaviors.

lucax88x commented 8 years ago

+1 that

TiagoSilvaPereira commented 8 years ago

+1 that

mrmashal commented 7 years ago

+1

azerafati commented 7 years ago

yes this should be implemented, for example when setting the ng-model we always need to have it as Unix time-stamp to send it to the server or when initialising the app ... But when showing to the user, date-picker should follow the given jalali format for example format: 'YY/MM/DD hh'

javad10170 commented 7 years ago

سلام من توی پروژه خودم از این کتابخانه استفاده کردم ولی مقادیر bind نمیشن تنظیمات کتابخانه ADMdtp.setOptions({ calType: 'jalali', format: 'YYYY/MM/DD', default: '', zIndex:99999999 }); مدل با مقادیر زیر هست birthdaydatepersian:"1336/12/13 00:00:00"

shaporty commented 7 years ago

باید مقدار پیشفرض رو بهش بدی هموت مقدار مدل رو تبدیل کن به تاریخ جی سانی و بهش بده

shaporty commented 7 years ago

ببخشید اول سلام