Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 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
  • Sep 14 01:11
    dalelotts edited #468
  • Sep 14 01:10
    dalelotts labeled #468
  • Sep 14 01:10
    dalelotts labeled #468
kshee95k
@kshee95k
im confused. can you elaborate?
kshee95k
@kshee95k
i mean i already have used
var myAppModule = angular.module('myApp', ['ui.bootstrap.datetimepicker']);
// controller
myAppModule.controller('DatePickerController', ['$scope', function($scope) {
// Runs the disable function passing in $view, $dates
$scope.disabled = function ($view, $dates) {
// filters the $view == 'day' so it can disable days = sunday and thursday
if ($view === 'day') {
$dates.filter(function (date) {
// creating notWeirdDate = new Date in order to get the utdDateValue
// as well as defining the function .getDay()
notWeirdDate = new Date(date.utcDateValue);
/
Date is weird. it uses utc format where it goes -1 a day
so for satuday it does 0-1 = 6 (0 is sunday in array format)
and so for thursday its 4-1 = 3 (4 is thursday in array format)
/
return (notWeirdDate.getDay() === 6 || notWeirdDate.getDay() === 3) ;
}).forEach(function (date) {;
date.selectable = false;
});
}
}
}]);
for disabling the dates i want
Dale Lotts
@dalelotts
If the user does not complete the selection process, no date is selected. Can you tell me a bit more about your use case? Specifically, I'd like to understand how the end user will complete their work with this feature implemented.
Also, when posting code, please format it by wrapping it in three back ticks "```"
kshee95k
@kshee95k
My use case is: working on a reservation system for a restaurant. When the restuarant is closed, the time cannot be selected on that particular date. for example, if the restaurant is open on mon from 11AM to 3 PM and 4 PM to 9 PM, i would have to disable from 3:05 to 3:55 PM and 9:05 PM to 10:55 AM
then end user cannot select the times when the restaurant is closed.
However, with my code, I am not sure how i am able to do it. With dates it is easier since the logic seems to be easier. I hope this helps when i explain it to you Dale Lotts
Dale Lotts
@dalelotts
I see, this is quite simple. For hour view, disable any times when the restaurant is closed. I don't see the need for any additional logic in this directive.
kshee95k
@kshee95k
do i disable it the same way i did the dates? or do i need to use a different library
rn i think i have to start with this:
var myAppModule = angular.module('MyApp', ['ui.dateTimeInput']);
Dale Lotts
@dalelotts
All dates can be disabled by setting date.selectable = false;
kshee95k
@kshee95k
okay but i understand how dates can be disabled by using date.selectable = false;
but how can times be unselectable within the calendar itself?
Dale Lotts
@dalelotts
This room, and the existing code repository will eventually migrate to Angular 4+. As a result, there is a new room and project for the AngularJs version of the date time picker - https://gitter.im/dalelotts/angularjs-bootstrap-datetimepicker. Please join the new room and support each other when using the AngularJS version of the directive
schwindyboo
@schwindyboo
image.png
Hi Dale, thanks for the great plug in. How do I configure so that the date/time selected (top) displays as selected
Thank you :)
Why can't I he he
@2227068304
how to display other languge in the plugin template i try moment.local("ch-zn") but it's invalid
Dale Lotts
@dalelotts
@2227068304 See the code in the demo directory - https://github.com/dalelotts/angular-bootstrap-datetimepicker/tree/master/demo - Note that you must set the local before the first render the date-time-picker (or re-render it after changing the locale)
Why can't I he he
@2227068304
tks the problem is solved because i can't import zh-cn.js in bower.json in my project i think it work automatically
Dale Lotts
@dalelotts
@2227068304 I understand. Probably best to migrate off of bower to npm or yarn. https://bower.io/blog/2017/how-to-migrate-away-from-bower/
'Apache' Rino
@rwijngaa_twitter
Hi, how come my datettime in the model is off by 1 hour when using modelType: 'milliseconds'. i.e. i live in NL, and fill in a date "14-12-2017 21:40" and this becomes 1513287600000 in my model which is 22:40 in my timezone according to https://www.epochconverter.com/
i do this before loading my page :
<script type='text/javascript'>
        moment.locale('nl');
        moment.tz.setDefault("Europe/Amsterdam");
        if (!sessionStorage.getItem('timezone')) {
          var tz = jstz.determine() || 'UTC';
          sessionStorage.setItem('timezone', tz.name());
        }
        var currTz = sessionStorage.getItem('timezone');
        console.log("CurrentTimeZone: ", currTz);
  </script>
'Apache' Rino
@rwijngaa_twitter
i'm using angularjs1.6 and angular-bootstrap-datetimepicker 1.1.4
Dale Lotts
@dalelotts
There may be a defect - I think earlier in this thread there was some discussion with a user that was using milliseconds but they did not provide a minimal example or failing test. Are you able to provide a working example so I can have a look?
'Apache' Rino
@rwijngaa_twitter
Hi, well that will take me a long time. I 'fixed' it in my local copy of datetimepicker.js on line 337 i added newDate = milliseconds - (60 * 60 * 1000); break; and that fixed it for me
Jeff Shamley
@jshamley
is it possible to disable the click outside the popup closing the popup?
Dale Lotts
@dalelotts
If you are using bootstrap for the dropdown (what you are calling the popup), then there is no way to disable it. However, you can use bootstrap's modal (https://getbootstrap.com/docs/3.3/javascript/#modals) to get the functionality you want. Note: This directive does not have any popover/dropdown functionality, you must always use library to provide that functionality.
Jeff Shamley
@jshamley
Thank you for that explanation, I'll dig in deeper to how this is set up in our app and find a solution.
Virendra Rajput
@virus-begin
Hello Dale, I'm using angular 1.6 and moment 2.13, I'm trying to apply validation from-to date , took same code from readme file. But in controller, $scope.dateRangeStart and $scope.dateRangeEnd values are undefined. what could be the issue?
jaydeept4f
@jaydeept4f
I have set (data-before-render) option for disable specific dates. But it's working first time page load.
Dale Lotts
@dalelotts
@virus-begin sorry for the delay - I didn't see your message until now. Did you resolve your issue?
@jaydeept4f do you have a live site I can look at?
jaydeept4f
@jaydeept4f
Okay i will provide...
jaydeept4f
@jaydeept4f

Sorry i not able to provide demo,

I disable dates as per ajax response using "before-render" and it is working properly. But if i call ajax second time and get other response then dates not disabled as per second response.

Dale Lotts
@dalelotts
FYI: this room is now dedicated to version 2.x of this component - which uses Angular 5+. Please join https://gitter.im/dalelotts/angularjs-bootstrap-datetimepicker and support each other when using the AngularJS (1.x) version of the directive
simonstewart
@simonstewart
Is there any documentation for different config options? Like showing the date picker in a popup instead of inline?
Luzo Tot
@luzo_tot_twitter

The demo folder is not available: https://github.com/dalelotts/angular-bootstrap-datetimepicker/tree/master/demo

Where is it possible to find examples, or projects using this library?

Luzo Tot
@luzo_tot_twitter
It is really difficult to learn to use the component without examples, just from this documentation
Dale Lotts
@dalelotts
I agree, having examples available would be nice. For now, the documentation is your only source of information, and it has room for improvement also. =) See https://dalelotts.github.io/angular-bootstrap-datetimepicker/components/DlDateTimePickerComponent.html#info and https://dalelotts.github.io/angular-bootstrap-datetimepicker/components/DlDateTimePickerComponent.html#readme
@simonstewart The majority of the documentation is found at https://dalelotts.github.io/angular-bootstrap-datetimepicker . This component does not provide any popup functionality. You are free to choose any popup implementation you like and place this picker inside your popup of choice. This is an intentional design choice to avoid the slew of issues that come from popup implementations.
shirley
@vercha
hello everyone
I'd like to know will bootstrap datetimepicker be self-adaption?
Thanks for any advice & help!
Dale Lotts
@dalelotts
Hey @vercha , I don't really know what that means. Can you explain?
Fabian Bernhard
@fbernhard
Hi there, is there a way to set min/max date? Thanks!