Code Monkey home page Code Monkey logo

Comments (13)

indrimuska avatar indrimuska commented on June 15, 2024

Hi @Dancia, minimum and maximum dates must have the same format of the model.

<div moment-picker="myDate"
     locale="en"
     format="HH:ii"
     min-view="day"
     min-date="'09:00'"
     max-date="'18:00'">
 </div>

You can also check out this plunker to better realize how it works.
Hope this helps! :)

from angular-moment-picker.

chandanv03 avatar chandanv03 commented on June 15, 2024

Hi @indrimuska ,

I have min date and max date fields,
my question is how do i disable future dates in min-date? keeping current date as the max date.
the same should be in max date as well

my code:

please help me out on this ,examples with code or plunker would be really great help for me.

from angular-moment-picker.

indrimuska avatar indrimuska commented on June 15, 2024

Hi @chandanv03, I can't see the example you've posted, can you please share it again? thanks

from angular-moment-picker.

chandanv03 avatar chandanv03 commented on June 15, 2024

from angular-moment-picker.

indrimuska avatar indrimuska commented on June 15, 2024

Ok, but in that link there's no working example I can run, just pieces of code :)

from angular-moment-picker.

indrimuska avatar indrimuska commented on June 15, 2024

Well, correct me if I'm wrong.
You want to have a field called minDate that has a restriction on maximum allowable date set to the value of maxDate property on your scope. You also want to "reset" the maximum date maxDate to the current date. In the same way minDate should be a restriction for a minimum allowable value for maxDate, also resettable to the current date. Isn't it?

from angular-moment-picker.

indrimuska avatar indrimuska commented on June 15, 2024

Could you check this plunker out?
https://plnkr.co/edit/RzIaRJUgMHbPefAdvbIx?p=preview

from angular-moment-picker.

chandanv03 avatar chandanv03 commented on June 15, 2024

from angular-moment-picker.

indrimuska avatar indrimuska commented on June 15, 2024

I am not sure I've totally understood your problem, but it seems that you don't want a dynamic min/max date, but your restriction will be hardcoded to the current date and time. Right?

Check out this plunker and update it with your change.

from angular-moment-picker.

chandanv03 avatar chandanv03 commented on June 15, 2024

from angular-moment-picker.

indrimuska avatar indrimuska commented on June 15, 2024

So does that plunker satisfy your needs?

from angular-moment-picker.

chandanv03 avatar chandanv03 commented on June 15, 2024

from angular-moment-picker.

indrimuska avatar indrimuska commented on June 15, 2024

Happy to hear that! :)

from angular-moment-picker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.