Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 18 22:26
    dependabot[bot] labeled #471
  • Nov 18 22:26

    dependabot[bot] on npm_and_yarn

    chore(deps-dev): bump semantic-… (compare)

  • Nov 18 22:26
    dependabot[bot] opened #471
  • Sep 14 18:34
    dalelotts closed #461
  • Sep 14 18:34
    dalelotts commented #461
  • Sep 14 18:33
    dalelotts labeled #461
  • Sep 14 18:33
    dalelotts unlabeled #461
  • Sep 14 18:32
    dalelotts labeled #463
  • Sep 14 18:32
    dalelotts unlabeled #463
  • Sep 14 18:32
    dalelotts unlabeled #463
  • Sep 14 18:32
    dalelotts closed #463
  • Sep 14 18:32
    dalelotts commented #463
  • Sep 14 18:31
    dalelotts labeled #468
  • Sep 14 18:30
    dalelotts unlabeled #468
  • Sep 14 18:30
    dalelotts unlabeled #468
  • Sep 14 18:30
    dalelotts closed #468
  • Sep 14 18:30
    dalelotts commented #468
  • Sep 14 07:16
    byronantak commented #468
  • Sep 14 06:19
    byronantak commented #468
  • Sep 14 01:26
    dalelotts commented #468
rcluan
@rcluan
@aitorMolinuevo have a look at the "Formatting the date in an input box" here (https://github.com/dalelotts/angular-bootstrap-datetimepicker). It suggests to use the angular-date-time-input directive to format dates
@dalelotts hello. nice work on this directive. could you tell me if it's possible to disable going to the year? For example, when I click on the name between the arrows I should not change the view.
rcluan
@rcluan
nevermind...think I've got it. cheers
aitorMolinuevo
@aitorMolinuevo
@rcluan Thanks for the answer! I get it working as i want! :)
Nadun Indunil
@nadunindunil

hello!
I faced an issue when date time picker was added into vendor.min.js(where all the bower dependencies are minified) file and the issue was - TypeError: (intermediate value)(intermediate value)(...) is not a function. issue was happened because of the missing semicolons I guess.
such as

"use strict" - semicolon is needed.

can someone help me with this issue. I used gulp to create minified file.
how ever adding the dependency as last in bower.json fixed the issue.
Thanks in advance!

Tyler Jones
@jylertones
Hello everyone, my organization is using the picker and is making efforts to make our application WCAG compliant (accessibility). I see that keyboard accessibility was discussed a little before, but perhaps not addressed. Would you guys accept a pull request if I took a stab at it?
Dale Lotts
@dalelotts
@jylertones Sure, I would love a PR! The only requirement is to follow the contributing guidelines.
Dale Lotts
@dalelotts
@nadunindunil Your concatenation process is introducing the problem - there are multiple ways to fix this issue - 1) Inject a ; between files when concatenating 2) Minify first, then concatenate. 3) move this directive to the end of the set of concatenated files.
Jean-Michel Hiver
@jhiver
Hello @dalelotts and thanks so much for that datetimepicker library! I had a question but I realized problem was in my code :-) So it will just be a BIG UP and THANKS :-)
Dale Lotts
@dalelotts
:+1:
4usmk
@4usmk
Hi everyone,I have a little problem about setting the location of the picker popup’s.
Do you have the way to set the location of the picker popup’s?
same "orientation" of bootstrap-datepicker?
Dale Lotts
@dalelotts
The picker does not have any built in "pop-up" functionality - that comes from Bootstrap or whatever pop-up library you are using - see the documentation for the appropriate library. What is the issue you are trying to solve?
Nadun Indunil
@nadunindunil
@dalelotts Thank you very much! I went with the option 3 (y)
Ilia
@noway
Is there a specific way of testing datepicker input fields through Prortractor? While it's quite easy to chuck in a value into input[type="text"], I seem to have to click through the time buttons in case of date time picker. Is there a way to set the day quicker?
Dale Lotts
@dalelotts
That's what the user needs to do, so that's what Protractor needs to do. Is it good enough for you only test that selecting a date updates the UI - not that it is a specific date?
Ilia
@noway
I ended up setting underlying date through model, thanks for answerting though
Alex Ivanov
@contributorpw

Hi there! Any ideas to store a date in Firebase. At now I need

{
    "-KgWCD_BRwdpbE2b9pZ4": {
        "datum": "2017-04-06T10:50",
        "datumUTC": 1491475800000,
        "timezoneOffset": -180
    }
}

My settings of the datetimepicker is

data-datetimepicker-config="{ dropdownSelector: '#datum', modelType: 'YYYY-MM-DDThh:mm' }"

I'd like a more advanced feature modelType Something like 'YYYY-MM-DDThh:mm+/-gmthh:mm'

Dale Lotts
@dalelotts
I have not personally used Firebase to store a date, but I would expect them to accept dates in ISO8601 format. You can use any format that moment.js will understand.
Paul W.
@binaryPUNCH
Hi silly question but would the dalelotts bootstrap datetimepicker work in angular4?
Or is there a different recommended alternative?
Dale Lotts
@dalelotts
Hi @amivit, no Angular support yet. I'll start working on it next month if my current contract does not renew.
saikrishnarao2
@saikrishnarao2
Could someone help me I am not able to set the value for angular-datetimepicker dynamically from angularjs controller function?
saikrishnarao2
@saikrishnarao2
I need to set the value of the datetimepicker element.Can you help me on that?
Dale Lotts
@dalelotts
@saikrishnarao2 just set the value on the model. For example, if ngModel="selectedDate", in the controller, setting $scope.selecctedDate will set the value for the date-time-picker and it will be reflected on the UI automatically
saikrishnarao2
@saikrishnarao2
thank you @dalelotts. It worked for me.
TheRealMaxion
@TheRealMaxion
Hi @dalelotts nice work on the directive! A thing I was wondering is if the class on row 19 of the template is a typo, since it looks a bit off that it is "dow" ?
TheRealMaxion
@TheRealMaxion
Also, I was trying to make it possible to navigate the dropdown using the keyboard, and though I was able to open it by setting the input to readonly and giving the span a tabindex, I was unable to navigate to anything useful inside the dropdown despite my limited efforts even with editing your template. Unless @jylertones was able to come up with something then I guess I'll have to make sure the users use the mouse like the others.
TheRealMaxion
@TheRealMaxion
@dalelotts ah never mind the alleged typo, just realized it's short for day of week
Dale Lotts
@dalelotts
@saikrishnarao2 :+1:
@TheRealMaxion good point, I don't think picker currently supports keyboard navigation. Wow, that's a big gap that has been in place for a long time! If you get something working, please let me know! Even better, send me a PR! =)
saikrishnarao2
@saikrishnarao2
Hi @dalelotts.I need another help.How do I set min date and max date in angular for the datetimepicker?
I think this is what you want...
I need to change minutes format inside timepicker, how can I set HH:mm instead of h:mm a?
William Kennedy
@williamknn
moment.locale() didn't change anything
William Kennedy
@williamknn
I wasn't importing my language locale
It's working now
saikrishnarao2
@saikrishnarao2
Thanks @williamknn It worked for me
Bharat Soni
@iiison
This message was deleted
Gareth
@GarethStar_twitter
Hi, how can past dates and times be disabled?
Let's read the docs, folks
Gareth
@GarethStar_twitter
This only seems to disable the dates, but not the times within the dates?
iv worked out how to do a filter for this but its really clunky
Gareth
@GarethStar_twitter
scope.startDateBeforeRender = function ($dates) {
if (!scope.blockHistoric) { return; }
var ranChecker = false;
var dateNow = new Date();
$dates.filter(function (date) {
var utcdate = new Date(date.utcDateValue);
var utc = new Date(utcdate.getTime() + dateNow.getTimezoneOffset() * 60000);
return utc.getTime() < dateNow;
}).forEach(function (date) {
var mo = moment();
var localTime = new Date(date.utcDateValue);
var isDisplayLengthNotDay = date.display.length > 2;
var isToday = mo.isSame(moment(date.utcDateValue), 'day');
var isMonth = mo.isSame(moment(date.utcDateValue), 'month');
var isYear = mo.isSame(moment(date.utcDateValue), 'year');
var isHoursSame = localTime.getHours() == dateNow.getHours();
var isMinutesLess = localTime.getMinutes() < dateNow.getMinutes();
var dateFormat = mo.minute(0).format("h:mm A");
var monthFormat = mo.minute(0).format("MMM");
var yearFormat = mo.minute(0).format("YYYY");
var display = date.display;
var isDisplayDateSame = display == dateFormat;
var isDisplayMonthSame = display == monthFormat;
var isDisplayYearSame = display == yearFormat;
var displaySame = ((isDisplayDateSame && isToday) || (isDisplayMonthSame && isMonth) || (isDisplayYearSame && isYear));
if (!isToday && !displaySame) {
date.selectable = false;
} else if ((((isDisplayLengthNotDay || date.past) || (!isHoursSame && isMinutesLess && !isToday)) && !displaySame) || !ranChecker) {
date.selectable = false;
};
ranChecker = true;
});
}
};
kshee95k
@kshee95k

Having trouble disabling specific dates.

var myAppModule = angular.module('myApp', ['ui.bootstrap.datetimepicker']);
myAppModule.controller('DatePickerController', ['$scope', function($scope) {
$scope.disabled = function(date, mode) {
return ( mode === 'day' && ( date.getDay() === 2 ) ); };
}]);

I have used the code above and doesnt work. Is there a easy way to do it?

Dale Lotts
@dalelotts

This is quite simple once the API is clear. Look at the example in the readme file and adapt it to your logic - https://github.com/dalelotts/angular-bootstrap-datetimepicker#restrict-past-dates-from-being-selected.

Try the following code:

$scope.disabled = function ($view, $dates) {
     if ($view === 'day') {
       $dates.filter(function (date) {
          return date.getDay() === 2;
        }).forEach(function (date) {
          date.selectable = false;
        });
    }
}

your html must also hook up the before-render function named disabled correctly for this to work. See documentation and examples folder.

kshee95k
@kshee95k
do i need the code that i have already written too? or should i delete it?
Dale Lotts
@dalelotts
You should be able to replace your disabled function with the disabled function I provided. I did not test the code at all but it should give you an idea of what you need to do.
kshee95k
@kshee95k
i got it thanks