by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Dale Lotts
    @dalelotts
    Use this room for the legacy AngularJS version of the date time picker
    kshee95k
    @kshee95k
    okay so i am not sure if you answered my question but i am going to ask again
    okay but i understand how dates can be disabled by using date.selectable = false;
    but how can times be unselectable within the calendar itself? In what way would you approach this? it would be appreciative
    Dale Lotts
    @dalelotts

    Dates are times are the same thing (i.e. Dates always have a time, but that time might be midnight). A time is represented by the number of milliseconds since Jan 1, 1970. You can observe this by calling new Date().getTime() Read in detail about dates at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date

    So, to disable times write a before-render callback, determine the $view you want to effect (probably hour or minute) , then in the callback iterate over the dates and set date.selectable = false; on times that you would like to disable.

    If you would like additional help you can hire me through CodeMentor (https://www.codementor.io/dalelotts) and we can work together to implement the code.

    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 :)

    Dale Lotts
    @dalelotts

    @schwindyboo https://github.com/dalelotts/angularjs-bootstrap-datetimepicker#formatting-the-date-in-an-input-box

    Use the angular-date-time-input directive to format the display of a date in an input box or allow users to enter a valid date with the keyboard.

    if you don't want user input via keyboard, don't use an input box.

    schwindyboo
    @schwindyboo
    Hi Dale, thanks for coming back. We are using the input directive already to format as necessary and the model type is a moment object. This is obviously related to the time zone. Can you advise the best way to make the selected moment object time zone agnostic?
    Dale Lotts
    @dalelotts
    Not sure what you mean by time zone agnostic or what problem you are having. Perhaps post a fiddle/jsbin that better explains what you are trying to do
    schwindyboo
    @schwindyboo
    Good idea :)
    Artur Cavalcante
    @ttuca123
    Hi @dalelotts, I have a bug with #datetimepicker referes a privates var in this component, in the moment that I build the project with npm install. How solve this problem in theses component. I liked most of use this component and would solve this. Thanks.
    Dale Lotts
    @dalelotts
    Hi @ttuca123, sorry to hear you have having problems. Can you post a call stack or a jsbin so I can see the code?
    Artur Cavalcante
    @ttuca123
    Well, I following tutorial and the component only build in machine local
    in my machine local, he does with success
    the problem is when build with npm install and the error is show
    ERROR in node_modules\angular-bootstrap-datetimepicker\angular-bootstrap-datetimepicker.d.ts.DlDateTimePickerComponent.html(1,6): : Property '_model' is private and only
    accessible within class 'DlDateTimePickerComponent<D>'.
    node_modules\angular-bootstrap-datetimepicker\angular-bootstrap-datetimepicker.d.ts.DlDateTimePickerComponent.html(7,13): : Property '_model' is private and only accessib
    le within class 'DlDateTimePickerComponent<D>'.
    node_modules\angular-bootstrap-datetimepicker\angular-bootstrap-datetimepicker.d.ts.DlDateTimePickerComponent.html(5,13): : Property '_model' is private and only accessib
    le within class 'DlDateTimePickerComponent<D>'.
    node_modules\angular-bootstrap-datetimepicker\angular-bootstrap-datetimepicker.d.ts.DlDateTimePickerComponent.html(6,13): : Property '_model' is private and only accessib
    le within class 'DlDateTimePickerComponent<D>'.
    node_modules\angular-bootstrap-datetimepicker\angular-bootstrap-datetimepicker.d.ts.DlDateTimePickerComponent.html(12,10): : Property '_model' is private and only accessi
    ble within class 'DlDateTimePickerComponent<D>'.
    node_modules\angular-bootstrap-datetimepicker\angular-bootstrap-datetimepicker.d.ts.DlDateTimePickerComponent.html(19,13): : Property '_model' is private and only accessi
    ble within class 'DlDateTimePickerComponent<D>'.
    node_modules\angular-bootstrap-datetimepicker\angular-bootstrap-datetimepicker.d.ts.DlDateTimePickerComponent.html(16,13): : Property '_model' is private and only accessi
    ble within class 'DlDateTimePickerComponent<D>'.
    node_modules\angular-bootstrap-datetimepicker\angular-bootstrap-datetimepicker.d.ts.DlDateTimePickerComponent.html(17,13): : Property '_model' is private and only accessi
    ble within class 'DlDateTimePickerComponent<D>'.
    node_modules\angular-bootstrap-datetimepicker\angular-bootstrap-datetimepicker.d.ts.DlDateTimePickerComponent.html(24,10): : Property '_model' is private and only accessi
    ble within class 'DlDateTimePickerComponent<D>'.
    node_modules\angular-bootstrap-datetimepicker\angular-bootstrap-datetimepicker.d.ts.DlDateTimePickerComponent.html(24,10): : Property '_model' is private and only accessi
    ble within class 'DlDateTimePickerComponent<D>'.
    node_modules\angular-bootstrap-datetimepicker\angular-bootstrap-datetimepicker.d.ts.DlDateTimePickerComponent.html(27,10): : Property '_model' is private and only accessi
    ble within class 'DlDateTimePickerComponent<D>'.
    if I alter variables of the component for public, the command npm install execute normally
    Artur Cavalcante
    @ttuca123
    But when build and publish in Heroku, this error ocurrs.
    Dale Lotts
    @dalelotts
    Thanks, I think I understand what is happening. I created a defect - dalelotts/angular-bootstrap-datetimepicker#425 - a new version of the component will be available in a few minutes.
    Also, please use https://gitter.im/dalelotts/angular-bootstrap-datetimepicker for angular 5+ components.
    Artur Cavalcante
    @ttuca123
    Ok, Thanks.
    Artur Cavalcante
    @ttuca123
    @dalelotts , what is expected to resolve this error?
    component preview?
    Artur Cavalcante
    @ttuca123
    Currently the component version is 2.1.0, correct?
    Dale Lotts
    @dalelotts
    Once the build passes and the change is merged into master, 2.1.1 will be released automatically - I need a bit more time, I got busy with something else for a bit.
    Dale Lotts
    @dalelotts
    @ttuca123 2.1.1 is available now on npm - please let me know if your problem is solved.
    Something went wrong with the automatic publishing to npm = install the latest version and I will fix the publish issue tomorrow
    Artur Cavalcante
    @ttuca123
    Thanks @dalelotts , my application build with success.
    with "angular-bootstrap-datetimepicker": "0.0.0-development", builded with success.
    Dale Lotts
    @dalelotts
    @ttuca123 I unpublished the bad 0.0.0-development version - the correct 2.1.1 is now available.
    Daniel Lara
    @FradaL
    Hi, I need help, I'm trying to use the datetimepicker, but when I select the first date, I need to block the previous dates in the second datetimpicker
    waynechong1995
    @waynechong1995
    HI @dalelotts , regarding the datetimepicker, is there any way to set the default view based on a value? is like every time i open it shows the range of current date, like this month (may 2018) for instance
    Dale Lotts
    @dalelotts
    Sorry for the delay, I was just notified of this. If you want to see a different startView based on some other value, there is no built-in way to do that but you can implement the logic yourself. Have a look at configureOn - https://github.com/dalelotts/angularjs-bootstrap-datetimepicker#configureon - just change the configuration when the startView should change, raise an event to cause the picker to re-read it's configuration and it should work as you expect
    Cosmin T.
    @TesloCosmin
    Hello guys. Is there a way to change the time picker format from 'h:mm tt' to 'HH:mm'. Basically from 12h format to 24h format?
    Cosmin T.
    @TesloCosmin
    @dalelotts , maybe you can answer to my question
    Cosmin T.
    @TesloCosmin
    I can't believe I missed that part :smile: Thanks!
    juke21
    @juke21
    Hello, any way to catch change events when clicking on the datetime picker? ng-change doesn't seem to work
    Dale Lotts
    @dalelotts
    @juke21 So sorry for the delay, just seeing this now. Yes, there is an on-set-time callback. See https://github.com/dalelotts/angularjs-bootstrap-datetimepicker#on-set-time