by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jul 04 02:53
    dalelotts labeled #461
  • Jul 04 02:53
    dalelotts commented #461
  • Jul 04 02:50
    dalelotts labeled #463
  • Jul 04 02:50
    dalelotts labeled #463
  • Jul 04 02:50
    dalelotts commented #463
  • Jul 04 02:44
    dalelotts commented #397
  • Jul 03 12:26
    MedZghal opened #463
  • Jul 02 20:02
    saharati commented #397
  • Jun 07 06:15
    dependabot[bot] labeled #462
  • Jun 07 06:15
    dependabot[bot] opened #462
  • Jun 07 06:15

    dependabot[bot] on npm_and_yarn

    chore(deps): bump websocket-ext… (compare)

  • May 02 12:33
    Anthony-Breneliere opened #461
  • Apr 30 11:43
    dependabot[bot] labeled #460
  • Apr 30 11:43

    dependabot[bot] on npm_and_yarn

    chore(deps-dev): bump jquery fr… (compare)

  • Apr 30 11:43
    dependabot[bot] opened #460
  • Mar 30 20:08
    dalelotts labeled #449
  • Mar 30 20:08
    dalelotts unlabeled #449
  • Mar 30 20:07
    dalelotts commented #449
  • Mar 27 17:44
    dalelotts commented #449
  • Mar 27 17:43
    dalelotts labeled #449
f3l1xss
@f3l1xss
Hi @dalelotts do we currently have a way to differentiate (change) event due to click at date picker and (change) event due to value Change (ngModel change or due to writeValue)?
Dale Lotts
@dalelotts
@f3l1xss Not explicitly. Can you tell me a bit about your use case?
f3l1xss
@f3l1xss
@dalelotts Thanks for your reply. Basically, I would want user to be able to set the date from query param, for example mywebsite.com?date=2020-02-03&timeslot=5 would preset the date picker value. I do not want this preset to trigger the change event, as I have bound the change event to other functionality (eg: to refresh my dom entity). I have tried setting the datepicker value through the ngModel and writeValue way but found that both still trigger change event. If only theres a difference in the change model triggered by manual click and ngmodel/value change.
Dale Lotts
@dalelotts
@f3l1xss usually in these cases I set the code logic such that I always want the change event to fire. It sounds like root cause might be that there is more than one path to refresh your dom entity. Now you need to know how the value was set and that seems like a code smell to me.
f3l1xss
@f3l1xss
Hi @dalelotts I understand your point. However, think about my query param use case. There could be tons of query parameters and user may or may not provide date among them. I would have to refresh my dom entity regardless of whether or not there is a date query param. Firing change event upon ngmodel change would thus redundantly refresh the dom twice.
From my experience with another 3rd party angular directive, there would usually be two separate events handling user interaction and modelChange as they are indeed two different events. If there is solution you have in mind albeit a 'hacky' one, please let me know
Dale Lotts
@dalelotts
@f3l1xss nothing comes to mind. Feel free to submit a PR for the additional event.
f3l1xss
@f3l1xss
@dalelotts Thank you for your prompt response, I'll submit a pr when I have the time
Dale Lotts
@dalelotts
Hey @amchidorian I saw a question come through from you, but I don't see it now. Did you get an answer?
amchidorian
@amchidorian
Hello @dalelotts ! I was wondering how to use the 'classes' attribute of the right and left button, but i finally found out.
But I may have another question, I'm a pretty new Angular user and i'm not quite sure how to use the "set value" accessor of the DlDateTimePickerComponent in order to preselectionned a date
amchidorian
@amchidorian
Well looks like i finally found out ! And btw your datepicker is awesome !
cajaykumar
@cajaykumar
Hello @dalelotts, I want to change the display format shown in the input text box when date is selected. The current format shown in input box is "Mar 7, 2020 12:00 AM" and I want to change this as "YYYY-MM-DD". I have injected the DL_DATE_TIME_DISPLAY_FORMAT in my component constructor but still its showing in same format. Can you please let me know how to fix this.
Thanks.
Dale Lotts
@dalelotts
Thanks @amchidorian glad you got it figured out
cajaykumar
@cajaykumar
Hello @dalelotts , I am using angular 8 date-time picker and have a requirement like if user doesn't finish the selection (say just selected date) and when tries to open date picker should start from dates view again. Could you please assist how can I achieve this?
Thanks.
Dale Lotts
@dalelotts
@cajaykumar I suppose one option might be to change the startView if there is an existing date value.
cajaykumar
@cajaykumar

@dalelotts I have the datepicker in a modal. When user doesn't finish selecting date time and closes the modal, the datepicker should display from day view. In my case its showing from where the selection left off. Yes, I tried setting the 'startView' to 'day' again when user closes the modal popup. Still date picker is displayed from time view. Please find my code below.

<dl-date-time-picker [(maxView)]='year' [(minView)]='minute' [(startView)]="startView" [(ngModel)]="startDate" [ngModelOptions]="{standalone: true}" [(minuteStep)]="5" [(rightIconClass)]="rightIconClass" [(leftIconClass)]="leftIconClass" (change)="onInputSelect()">
</dl-date-time-picker>
//Initial Datepicker config
startView = 'day';
rightIconClass = [
'glyphicon', 'glyphicon-arrow-right'
];
leftIconClass = [
'glyphicon', 'glyphicon-arrow-left'
];
//when user closes modal. on close icon call back I have reset the startView to 'day'.

Dale Lotts
@dalelotts
@cajaykumar you'll have to put up a working example if you want me to debug your code.
cajaykumar
@cajaykumar
@dalelotts In your date-picker-input example, whenever user clicks on calendar icon I need to re-render the date picker from day view.
Use case: User select date in day view of date picker and then time view is displayed. User will not select time and clicks anywhere on the page, date-picker is closed and when reopened it is displayed from time-view but not day view. I need to re-render it from start. Kindly assist.
https://stackblitz.com/github/dalelotts/angular-bootstrap-datetimepicker-demo?file=src%2Fapp%2Fexamples%2Fdate-picker-input%2Fdate-picker-input.component.html
Dale Lotts
@dalelotts
@cajaykumar the existing behavior you describe might be exactly what the user wants - I've been in lots of user groups where they say they don't want to have to start over on a something if they make a mistake. Something to think about. Back to your desired behavior, ideally there would be an event raised when the view changes but that doesn't exist. I think the next closest option would be to use the 'selectFilterfunction - the second parameter is view name, maybe you can track the view the user is currently on my saving the view name as the 'startView' then resetstartViewto the original value onchange` - just an idea, I didn't try it.
cajaykumar
@cajaykumar

Hi @dalelotts, I have tried the way you suggested but it dint work. Here in I am sharing sample working example of my requirement. Kindly take a look and assist. We have deployment scheduled in April first week.

https://stackblitz.com/edit/dalelotts-angular-date-time-picker?file=src/app/app.component.html

Please note on click of close or Cancel button of modal, I am setting startView to 'day' and also resetting the ngModel date variable. When I re-open the modal date picker is displaying the view I left before closing the modal. Thanks.

Dale Lotts
@dalelotts
I'm sorry, I cannot look at my code and imagine what you want your code to do. I really need to look at your code to get it to do what you want. Nor can I help you on your timeline. You can try codementor.io to find someone to help you. You can hire me directly on codementor if you like but it's certainly not required - https://www.codementor.io/@dalelotts - Maybe try StackOverflow or maybe someone else here has time to help you out given your timeline
stasken
@stasken

Hello, thanks for the awesome perfectly working datetimepicker!
I am creating events to add to Google Calendar where you first pick a begin date, [(selectedDate)} double binding, this works.
Now, I want the end datetimepicker to pop up starting on the selected start date.
I saw that the startDate needs a number, what kind of number? I converted the selectedDate to a Number but this didn't work.

Thanks!

Dale Lotts
@dalelotts
@stasken try something like startDate = new Date(1985, OCT, 18).getTime();
stasken
@stasken
Thank you very much, I figured it out you can only provide until seconds to give a valid StartDate. So I extracted them out of the selected beginning date. Thanks!