Hi I am developing web application in angularjs. I am developing form where i have one textbox with calender option. I am using 720kb date picket pluggin. I am trying to apply various options given in below document. Link. date-min-limit="" where i can assign date so that previous dates i can block. I tried as date-min-limit="08/14/2017" and i am able to disable dates before 14(today.). I want to assign date from controller as date-min-limit="d" and in controller var d = new Date(); But this does not working for me. May i know what is the correct method to assign date in html.
Any help would be greatly appreciated. Thank you.
Add a comment
|
2 Answers
Try this once for javascript
var d = new Date().toLocaleDateString();
(or) this if you are using $scope to bind properties to controllers in angularjs
$scope.d = new Date().toLocaleDateString();
Returns the string version of date based on the Locale. If you want to customize look on Moziila Docs here
3 Comments
nivas
how you can bind a js variable to angularjs in html, i think this is what you need
$scope.d = new Date().toLocaleDateString();Niranjan Godbole
Yeah yeah. I do not why i forgot the basic thing.
Niranjan Godbole
Thank you for answering. I have marked as answered.