MinDate and MaxDate are not working for the native date picker in Ionic 4start Date should currentDate in Ionic2 dateTimeIonic Native Date Picker not working on AndroidIonic Time and Date PickerIonic 4 native plugin not workingIon date picker is not working for date selector in ionic 4Ionic Native HTTP client (@ionic-native/http) not working when importingAdd default date to ionic-datetime - ionic 4 angular projectionic 4 flashlight native plugin not workingHow to convert the date in Ionic date picker to 'Y-m-d H:i:s' In Ionic 4Not able to set the image using the Image Picker In Ionic 4

What makes Ada the language of choice for the ISS's safety-critical systems?

How to handle self harm scars on the arm in work environment?

is it possible for a vehicle to be manufactured witout a catalitic converter

Giant Steps - Coltrane and Slonimsky

Active low-pass filters --- good to what frequencies?

How to safely destroy (a large quantity of) valid checks?

How to trick the reader into thinking they're following a redshirt instead of the protagonist?

How come the nude protesters were not arrested?

Is this use of the expression "long past" correct?

How does an ordinary object become radioactive?

I have a problem assistant manager, but I can't fire him

How to communicate to my GM that not being allowed to use stealth isn't fun for me?

How is water heavier than petrol, even though its molecular weight is less than petrol?

Soft question: Examples where lack of mathematical rigour cause security breaches?

Does the Long March-11 increase its thrust after clearing the launch tower?

Pre-1972 sci-fi short story or novel: alien(?) tunnel where people try new moves and get destroyed if they're not the correct ones

Overlapping String-Blocks

What speaks against investing in precious metals?

Fixing obscure 8080 emulator bug?

Winning Strategy for the Magician and his Apprentice

How can I make some of my chapters "come to life"?

Can Rydberg constant be in joules?

Using "subway" as name for London Underground?

Why do some employees fill out a W-4 and some don't?



MinDate and MaxDate are not working for the native date picker in Ionic 4


start Date should currentDate in Ionic2 dateTimeIonic Native Date Picker not working on AndroidIonic Time and Date PickerIonic 4 native plugin not workingIon date picker is not working for date selector in ionic 4Ionic Native HTTP client (@ionic-native/http) not working when importingAdd default date to ionic-datetime - ionic 4 angular projectionic 4 flashlight native plugin not workingHow to convert the date in Ionic date picker to 'Y-m-d H:i:s' In Ionic 4Not able to set the image using the Image Picker In Ionic 4






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I am working in my Ionic 4 project and I have used the native date picker plugin. It is working fine but I am not able to set the min and max date in it for the Android.



This is my tab2.page.html:



<ion-input formControlName="startchallenge" placeholder="Select Date" (click)="datePickershow()" [readonly]=true></ion-input>


This is my tab2.page.ts:



datePickershow()
this.datePicker.show(
date: new Date(),
mode: 'date',
androidTheme: this.datePicker.ANDROID_THEMES.THEME_HOLO_DARK,
minDate: new Date().toISOString(),
maxDate: new Date(new Date().setDate(new Date().getDate() + 10)).toISOString(),
).then(
date => console.log('Got date: ', date),
err =>
console.log('Error occurred while getting date: ', err)
);
}


I have used min and max date in Android after that the user is able to select the back date from today because I have used the min date as a today date but the problem is that user is able to select the previous date in Android.



Any help is much appreciated.










share|improve this question






























    1















    I am working in my Ionic 4 project and I have used the native date picker plugin. It is working fine but I am not able to set the min and max date in it for the Android.



    This is my tab2.page.html:



    <ion-input formControlName="startchallenge" placeholder="Select Date" (click)="datePickershow()" [readonly]=true></ion-input>


    This is my tab2.page.ts:



    datePickershow()
    this.datePicker.show(
    date: new Date(),
    mode: 'date',
    androidTheme: this.datePicker.ANDROID_THEMES.THEME_HOLO_DARK,
    minDate: new Date().toISOString(),
    maxDate: new Date(new Date().setDate(new Date().getDate() + 10)).toISOString(),
    ).then(
    date => console.log('Got date: ', date),
    err =>
    console.log('Error occurred while getting date: ', err)
    );
    }


    I have used min and max date in Android after that the user is able to select the back date from today because I have used the min date as a today date but the problem is that user is able to select the previous date in Android.



    Any help is much appreciated.










    share|improve this question


























      1












      1








      1








      I am working in my Ionic 4 project and I have used the native date picker plugin. It is working fine but I am not able to set the min and max date in it for the Android.



      This is my tab2.page.html:



      <ion-input formControlName="startchallenge" placeholder="Select Date" (click)="datePickershow()" [readonly]=true></ion-input>


      This is my tab2.page.ts:



      datePickershow()
      this.datePicker.show(
      date: new Date(),
      mode: 'date',
      androidTheme: this.datePicker.ANDROID_THEMES.THEME_HOLO_DARK,
      minDate: new Date().toISOString(),
      maxDate: new Date(new Date().setDate(new Date().getDate() + 10)).toISOString(),
      ).then(
      date => console.log('Got date: ', date),
      err =>
      console.log('Error occurred while getting date: ', err)
      );
      }


      I have used min and max date in Android after that the user is able to select the back date from today because I have used the min date as a today date but the problem is that user is able to select the previous date in Android.



      Any help is much appreciated.










      share|improve this question
















      I am working in my Ionic 4 project and I have used the native date picker plugin. It is working fine but I am not able to set the min and max date in it for the Android.



      This is my tab2.page.html:



      <ion-input formControlName="startchallenge" placeholder="Select Date" (click)="datePickershow()" [readonly]=true></ion-input>


      This is my tab2.page.ts:



      datePickershow()
      this.datePicker.show(
      date: new Date(),
      mode: 'date',
      androidTheme: this.datePicker.ANDROID_THEMES.THEME_HOLO_DARK,
      minDate: new Date().toISOString(),
      maxDate: new Date(new Date().setDate(new Date().getDate() + 10)).toISOString(),
      ).then(
      date => console.log('Got date: ', date),
      err =>
      console.log('Error occurred while getting date: ', err)
      );
      }


      I have used min and max date in Android after that the user is able to select the back date from today because I have used the min date as a today date but the problem is that user is able to select the previous date in Android.



      Any help is much appreciated.







      ionic-framework ionic4






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 2 at 17:50







      Raghav

















      asked Mar 20 at 9:35









      RaghavRaghav

      5482325




      5482325






















          2 Answers
          2






          active

          oldest

          votes


















          2














          Try This:



          minDate: new Date().valueOf(),
          maxDate: new Date(new Date().setDate(new Date().getDate() + 10)).valueOf(),


          This will solve your problem.






          share|improve this answer






























            1














            I think you should use ion-datetime, which provide easiest way to getting date or time from user.
            There are lots of methods to formate date and time input.






            share|improve this answer























            • I was using that but my client doesn't like the UI so I changed to this.

              – Raghav
              Mar 25 at 6:51











            • In this, Can you please help me?

              – Raghav
              Mar 25 at 6:52











            • Sorry @Raghav, I have no idea how to change the UI.

              – Kishan Bharda
              Mar 25 at 7:01











            • Okay. but Can you help me in this question?

              – Raghav
              Mar 25 at 7:04











            • Which type of help you need ? I will sure help you, if i am able to.

              – Kishan Bharda
              Mar 25 at 7:12











            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55257583%2fmindate-and-maxdate-are-not-working-for-the-native-date-picker-in-ionic-4%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            Try This:



            minDate: new Date().valueOf(),
            maxDate: new Date(new Date().setDate(new Date().getDate() + 10)).valueOf(),


            This will solve your problem.






            share|improve this answer



























              2














              Try This:



              minDate: new Date().valueOf(),
              maxDate: new Date(new Date().setDate(new Date().getDate() + 10)).valueOf(),


              This will solve your problem.






              share|improve this answer

























                2












                2








                2







                Try This:



                minDate: new Date().valueOf(),
                maxDate: new Date(new Date().setDate(new Date().getDate() + 10)).valueOf(),


                This will solve your problem.






                share|improve this answer













                Try This:



                minDate: new Date().valueOf(),
                maxDate: new Date(new Date().setDate(new Date().getDate() + 10)).valueOf(),


                This will solve your problem.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Apr 2 at 10:55









                RaghavRaghav

                5482325




                5482325























                    1














                    I think you should use ion-datetime, which provide easiest way to getting date or time from user.
                    There are lots of methods to formate date and time input.






                    share|improve this answer























                    • I was using that but my client doesn't like the UI so I changed to this.

                      – Raghav
                      Mar 25 at 6:51











                    • In this, Can you please help me?

                      – Raghav
                      Mar 25 at 6:52











                    • Sorry @Raghav, I have no idea how to change the UI.

                      – Kishan Bharda
                      Mar 25 at 7:01











                    • Okay. but Can you help me in this question?

                      – Raghav
                      Mar 25 at 7:04











                    • Which type of help you need ? I will sure help you, if i am able to.

                      – Kishan Bharda
                      Mar 25 at 7:12















                    1














                    I think you should use ion-datetime, which provide easiest way to getting date or time from user.
                    There are lots of methods to formate date and time input.






                    share|improve this answer























                    • I was using that but my client doesn't like the UI so I changed to this.

                      – Raghav
                      Mar 25 at 6:51











                    • In this, Can you please help me?

                      – Raghav
                      Mar 25 at 6:52











                    • Sorry @Raghav, I have no idea how to change the UI.

                      – Kishan Bharda
                      Mar 25 at 7:01











                    • Okay. but Can you help me in this question?

                      – Raghav
                      Mar 25 at 7:04











                    • Which type of help you need ? I will sure help you, if i am able to.

                      – Kishan Bharda
                      Mar 25 at 7:12













                    1












                    1








                    1







                    I think you should use ion-datetime, which provide easiest way to getting date or time from user.
                    There are lots of methods to formate date and time input.






                    share|improve this answer













                    I think you should use ion-datetime, which provide easiest way to getting date or time from user.
                    There are lots of methods to formate date and time input.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 25 at 6:48









                    Kishan BhardaKishan Bharda

                    139113




                    139113












                    • I was using that but my client doesn't like the UI so I changed to this.

                      – Raghav
                      Mar 25 at 6:51











                    • In this, Can you please help me?

                      – Raghav
                      Mar 25 at 6:52











                    • Sorry @Raghav, I have no idea how to change the UI.

                      – Kishan Bharda
                      Mar 25 at 7:01











                    • Okay. but Can you help me in this question?

                      – Raghav
                      Mar 25 at 7:04











                    • Which type of help you need ? I will sure help you, if i am able to.

                      – Kishan Bharda
                      Mar 25 at 7:12

















                    • I was using that but my client doesn't like the UI so I changed to this.

                      – Raghav
                      Mar 25 at 6:51











                    • In this, Can you please help me?

                      – Raghav
                      Mar 25 at 6:52











                    • Sorry @Raghav, I have no idea how to change the UI.

                      – Kishan Bharda
                      Mar 25 at 7:01











                    • Okay. but Can you help me in this question?

                      – Raghav
                      Mar 25 at 7:04











                    • Which type of help you need ? I will sure help you, if i am able to.

                      – Kishan Bharda
                      Mar 25 at 7:12
















                    I was using that but my client doesn't like the UI so I changed to this.

                    – Raghav
                    Mar 25 at 6:51





                    I was using that but my client doesn't like the UI so I changed to this.

                    – Raghav
                    Mar 25 at 6:51













                    In this, Can you please help me?

                    – Raghav
                    Mar 25 at 6:52





                    In this, Can you please help me?

                    – Raghav
                    Mar 25 at 6:52













                    Sorry @Raghav, I have no idea how to change the UI.

                    – Kishan Bharda
                    Mar 25 at 7:01





                    Sorry @Raghav, I have no idea how to change the UI.

                    – Kishan Bharda
                    Mar 25 at 7:01













                    Okay. but Can you help me in this question?

                    – Raghav
                    Mar 25 at 7:04





                    Okay. but Can you help me in this question?

                    – Raghav
                    Mar 25 at 7:04













                    Which type of help you need ? I will sure help you, if i am able to.

                    – Kishan Bharda
                    Mar 25 at 7:12





                    Which type of help you need ? I will sure help you, if i am able to.

                    – Kishan Bharda
                    Mar 25 at 7:12

















                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55257583%2fmindate-and-maxdate-are-not-working-for-the-native-date-picker-in-ionic-4%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript