Date Format and Date Picker

I have a few issues with the date picker, especially regarding the date format. I need to create a date format similar to "ddMMyyyy", with no characters like slash or minus. this is my markup

HTML

<input type="text" datepicker-popup="{{format}}" show-weeks="false" ng-model="Fromdate" show-button-bar='false'>

and what is my javascript format

Js

  $scope.format='ddMMyyyy';

Is this the right way to make a format? Because if I select a date from a datepicker, it seems that this is not so, but if I type, then errors occur.
the first four numbers were rated as a year, so if I type '01022014' I aspect in early February 2014, instead of the date qualifier evaluating 14 of the month (20 not month) of 0102. The second question, I would like to put the Picker option of the date in the js file, and not in the markup, for example:

HTML

<input type="text" datepicker-popup="{{format}}" ng-model="Fromdate" datepicker-options="options">

Js

$scope.options={
    show-weeks:"false"
    show-button-bar:'false'
}

, , ?

+4
1

Uib-Datepicker Js:

$scope.dateOptions = {
        showWeeks: false,
        format: 'ddMMyyyy'
    };

HTML:

 <uib-datepicker ng-model="selectedDate" datepicker-options="dateOptions" ng-required="true"></uib-datepicker> 
0

Source: https://habr.com/ru/post/1532109/


All Articles