You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Great little library, thanks for sharing with the world!
In your docs you have put this as an option....
date_format: allows you to output a custom date format from the chosen Date object (defaults to MM/DD/YYYY)
At first I thought this meant passing a string value something like 'MM/DD/YYYY' but when that failed and I looked at the sourcecode and saw that date_format is a Function, I then tried setting a function for this options but I never was able to get the right format to not throw a bunch of console errors.
From the sourcecode initial default setting I can see that it is set with a function like this...
I have tried re-arranging those values with my own passed in date_format function however I never could get it to work.
Could you please share a quick demo of how to use and set a custom date format please? I have tried 20 combinations with no luck so I could use the help!
The text was updated successfully, but these errors were encountered:
It turns out that none of my custom options werir working! I thought the library had a bug in it but now after lots of testing, I see the problem I had.
I have a Task list which could be anywhere from 1 to 100+ fileds on a page that need a Date Picker like this attached to!
Each of these items is added to the DOM after the DOM has loaded. So in my JavaScript creation process that is creating my "Task" and inserting them into the DOM, that is where I then attach an instance of this Date Picker library to the fields for each record.
The result is that it works great, with the exception that any custom options passed in are strangley ignored!
Now when I do a test with a single form field using this library and do not have to attach it after the DOM is loaded, then all my custom options work!
So I was able to get the date_format and all other options to work on the library, just not where I need them, not yet anyways.
If you or anyone has any suggestions for a solution to my situation, I would love to hear ideas!
In case anyone comes across this issue like I did, the correct way to do it is something like this pretty straightforward if you look at the source, as jason said):
$input.minical({date_format: date_dd_mm_yyyy});// format minical dates to DD/MM/YYYYfunctiondate_dd_mm_yyyy(date){return[date.getDate(),date.getMonth()+1,date.getFullYear()].join("/");}
Great little library, thanks for sharing with the world!
In your docs you have put this as an option....
date_format: allows you to output a custom date format from the chosen Date object (defaults to MM/DD/YYYY)
At first I thought this meant passing a string value something like
'MM/DD/YYYY'
but when that failed and I looked at the sourcecode and saw thatdate_format
is a Function, I then tried setting a function for this options but I never was able to get the right format to not throw a bunch of console errors.From the sourcecode initial default setting I can see that it is set with a function like this...
I have tried re-arranging those values with my own passed in
date_format
function however I never could get it to work.Could you please share a quick demo of how to use and set a custom date format please? I have tried 20 combinations with no luck so I could use the help!
The text was updated successfully, but these errors were encountered: