angularjs - Angular time validation -


in following sample of code creating input take time ex. meeting over.

           <input ui-timepicker                                    name="eventtimepickerto"                                    id="eventtimepickerto"                                    class="form-control"                                    autocomplete="off"                                    attachlevel="-1"                                    placeholder="@webresources.placeholderendtime"                                    ng-model="eventdetails.datetimeto"                                    time-pattern="@validatorregex.validtimeorempty"                                    ng-disabled="eventdetails.permissions.timepickerdisabled"                                    ng-change="saveeventdetails()"                                    ng-blur="saveeventdetails()" /> 

what want validate input should have max time 14:00 , print error message in case of time>14:00. unfortunatelly ng-max doesn't work.. welcome!

try using min , max attributes, set date string. example

<input class="col-xs-12 -th-txt" type="date" name="date_field_{{field.id}}"                        ng-if="field.validationminvalue && field.validationmaxvalue"                        ng-required="field.required"                        min="{{field.validationminvalue}}"                        max="{{field.validationmaxvalue}}"                        ng-model="field.model" /> 

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -