angular-ui-datepicker

How to change date format from mm/dd/yyyy to dd/mm/yyyy?

杀马特。学长 韩版系。学妹 提交于 2020-01-17 05:07:31
问题 I am using this library. I am having trouble converting the date format. When I pick a new date it should display date in dd/mm/yyyy 回答1: <input type="text" ui-date-format="dd/mm/yy" .../> EDIT: If you want the date on the input to appear in dd/mm/yy format as well, you need to init dateOptions with the format: $scope.dateOptions = { dateFormat: 'dd/mm/yy', } And HTML: <input type="text" ui-date-format="dd/mm/yy" ng-model="ngModel" ui-date="dateOptions"/> updated fiddle 来源: https:/

AngularJS Controller resetting $scope variables after setting

╄→гoц情女王★ 提交于 2019-12-24 20:01:05
问题 I am trying to implement a simple datepicker using the akveo AngularJS project. When I change my date,I am setting a $scope variable from on-change function. When I debug, I can see that the correct picked value is being passed and $scope.simStartDate is actually changing to the set date. However, when I try to read it later, in ParamsFormBtnClicked() function, the has reset back to its original value. It looks like I am changing a value in a different scope, but I cannot figure out where.

Angular-UI date picker is in invalid state when specified the date format as 'd-M-yyyy' and ng-model with a string value as “2014-08-31T00:00:00Z”

眉间皱痕 提交于 2019-12-21 04:41:13
问题 I am getting a date time value from asp.net mvc controller as "2014-08-31T00:00:00Z". When I bind this value to my angular-ui datepicker control it's state is showing as ng-invalid ng-invalid-date. I am getting the date-format as well from the mvc controller so I am binding the date-format as well in my html. When I am debugging the ui-bootstrap-tpls.js (latest version) file at line 1807 It's always coming as undefined. I have tried so many alternatives but I am unable to succeed. :(

Angular erases invalid content from input inside directive

折月煮酒 提交于 2019-12-10 20:33:51
问题 I have directive where I'm dynamically adding other directives and attributes: app.directive('lrDatetime', function ($compile) { return { restrict: 'AE', require: ["ngModel"], scope: { ngModel: "=", item: "=" }, templateUrl: "template.html", compile: function compile(element, attrs) { var datepicker = element.find(".lr-datepicker"); if (attrs.required === "true") { datepicker.attr("ng-required", "true"); } return { pre: function preLink(scope, iElement, iAttrs, controller) { }, post: function