Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49235

How to validate year with format yyyy in ts?

$
0
0

@anespa wrote:

Friends,

I need to add validation for year eg: 2007 , how it can write ?

eg: for no i can write as


static isValid(control: FormControl): any {

       if(isNaN(control.value)){
           return {
               "not a number": true
           };
       }

       return null;
   }

but how to validate yyyy ? also check they will not provide years more than current year. eg must allow upto 2018 , not allow 2019 now…

please advise

Thanks

Anes

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49235

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>