Search Posts

Category: datepicker

AngularJS uib-datepicker not properly working

Now I have extensively looked for a answer as to why this does not work. I had multiple other co-workers try to help with this issue nothing seems to be working. The scenario: We in the application use uib-datepicker as a custom component. Here is the code for the view: <div class=”form-group”> <label ng-if=”ariaLabel” class=”control-label {{labelClass ? labelClass : defaultLabelClass}}”>{{ariaLabel}}&nbsp;<span ng-if=”ariaRecommended” class=”recommended”>**</span><span ng-if=”ariaRequired” class=”required”>*</span></label> <div class=”{{fieldClass ? fieldClass : defaultInputClass}}”> <div class=”input-group”> <input type=”text” class=”form-control” […]

AngularJS Material Datepicker change format

I am using the AngularJS Datepicker for a project. When posting a date I succeed on getting data back but the problem is that I get the date in the format of 2018-05-23T06:00:00.000Z. Is there a way to get it to show just 2018-05-23? This is what I have as my current datepicker // Date picker $scope.myDate = new Date(); $scope.minDate = new Date( $scope.myDate.getFullYear(), $scope.myDate.getMonth() – 2, $scope.myDate.getDate()); $scope.maxDate = new Date( $scope.myDate.getFullYear(), $scope.myDate.getMonth() […]

Datepicker value is NaN when used in Date.parse

I’m using basic bootstrap datepicker… <div class=”input-group date” data-provide=”datepicker”> <input type=”text” class=”form-control” name=”startDate” id=”startDate” value=”20/01/2016″> <div class=”input-group-addon”> <span class=”glyphicon glyphicon-th”></span> </div> </div> $.fn.datepicker.defaults.format = “dd/mm/yyyy”; $(‘.datepicker’).datepicker({ startDate: ‘-3d’ }); In my App.js I have a filter for filtering a JSON object list (this filter works if I hard code dates in the IF such as “> ’01/01/2016′”). I’m struggling to get the value the user selects in the datepicker. //Filter: Dates WIP App.filter(‘dateRange’, function () […]

Display date is an md-datepicker field

Dates are coming from API for me. I need to display the date in a md-datepicker field. I’m getting date but it is not displaying in a datepicker. Date is not fetching in a datepicker. Can anyone please tell how to display in a datepicker field. var app = angular .module(‘app’, [‘ngMaterial’, ‘md-steppers’]); app.controller(‘mainCtrl’, [“$scope”, “$rootScope”, function($scope, $rootScope) { $scope.dateBirth = new Date(2014, 3, 19); var a = new Date($scope.dateBirth) var day = a.getDate(); var […]

Call date-picker view on custom button click

I use this library for date-picker. I am trying to open date-picker on clicking by custom button. This is my default input and it works fine. <input name=”pickerFromDate” date-time ng-model=”model[options.key]” id=”pickerFromDate” min-view=”month” class=”edb-input input-group-input” placeholder=”{{to.placeholder}}” max-date=”maxDate” date-change=”changeMinValue” format=”MMM DD, YYYY” validation=”required” watch-direct-changes=”true” /> And here is my custom button, by clicking on this button i want to open my calendar view, like i a’m clicking on input. <button type=”button” class=”btn btn-default” ng-click=”setFocus($event);”> <i class=”fa fa-calendar”></i> […]

AngularJS: mdDatepicker is one day-off

I’m using Angularjs Material datepicker extension Here is a simple usage example: <md-datepicker ng-model=”$ctrl.date”></md-datepicker> And in my app config: $mdDateLocaleProvider.formatDate = function (date) { if (!date) { return ”; } return moment(date).format(‘YYYY-MM-DD’); }; And here is a problem I facing – when a date was selected via calendar it returns correct value, but when I type an exact date e.g. 2012-12-12 it gives me a one day off value Tue Dec 11 2012 00:00:00 GMT-0500 […]

Datepicker validation not functioning on first try

I am currently working on a site using MEAN. In this site, I am using html5 datepicker but since it is not supported on some browsers, I used jquery datepicker as fallback and successfully managed to make it work. Another thing I want is to display an error message if the user’s selected date is valid. A date is valid if it is between 1900-01-01 and the current date. Now, the problem is whenever I […]

Next Page »