0

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.

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

3 Comments

how you can bind a js variable to angularjs in html, i think this is what you need $scope.d = new Date().toLocaleDateString();
Yeah yeah. I do not why i forgot the basic thing.
Thank you for answering. I have marked as answered.
1

Documentation states that the parameter is a string. Therefore the correct syntax should be:

date-min-limit="{{d}}"

I believe it this will not require invoking {{d.toString()}} but you can check that.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.