Promact / md2

Angular2 based Material Design components, directives and services are Accordion, Autocomplete, Collapse, Colorpicker, Datepicker, Dialog(Modal), Menu, Multiselect, Select, Tabs, Tags(Chips), Toast and Tooltip.
http://code.promactinfo.com/md2/
MIT License
379 stars 112 forks source link

Runtime Error: MD_DATE_FORMATS (Datepicker) #242

Closed janelett closed 7 years ago

janelett commented 7 years ago

Since 0.0.24 i get the the following error after i click to open the calender The version 0.0.22 runs just fine.

Error: MD_DATEFORMATS at Md2MonthView (http://localhost:8100/build/main.js:107963:13) at createClass (http://localhost:8100/build/main.js:11154:13) at createDirectiveInstance (http://localhost:8100/build/main.js:10979:5) at createViewNodes (http://localhost:8100/build/main.js:12342:17) at createEmbeddedView (http://localhost:8100/build/main.js:12235:5) at callWithDebugContext (http://localhost:8100/build/main.js:13462:9) at debugCreateEmbeddedView (http://localhost:8100/build/main.js:12995:5) at TemplateRef.prototype.createEmbeddedView (http://localhost:8100/build/main.js:10560:9) at ViewContainerRef_.prototype.createEmbeddedView (http://localhost:8100/build/main.js:10352:9) at SwitchView.prototype.create (http://localhost:8100/build/main.js:20490:9)

I use the following:

<md2-datepicker [(ngModel)]="disasterEvent.occurredAt" type="datetime" touchUi = "true" placeholder="Date Time" format="d.M.y HH:mm">

when i go back to 0.0.22 I dont get the error any ideas?

tested with chrome and edge

dharmeshpipariya-zz commented 7 years ago

@janelett could you please provide plunkr demo, use plunke template [Plunker template: http://plnkr.co/edit/rQmUz8WYRh5Vz4gwY8E4?p=info](Plunker template: http://plnkr.co/edit/rQmUz8WYRh5Vz4gwY8E4?p=info)

leonida2390 commented 7 years ago

Same issue. I imported only the Md2DatepickerModule. I hope that the link works http://plnkr.co/edit/Mj9nbiocBiYZMjFc69HE?p=preview

hiago-b-oliveira commented 7 years ago

@janelett, @leonida2390,

As a possible workaround, you can import MdNativeDateModule in your main.ts.

Here is the plunkr that you provided after apply the workaround: http://embed.plnkr.co/1dfwyg/

janelett commented 7 years ago

@hiago-b-oliveira the workaround fixes the issue for me thank you

I get the issue #239 now @dharmeshpipariya could you estimate how long it takes for you to fix it its pretty major. Great work so far thank you.