Gillardo / bootstrap-ui-datetime-picker

AngularJs directive to allow use of the bootstrap UI date/time pickers in a single dropdown
MIT License
306 stars 168 forks source link

Display date and time pickers simultaneously #122

Open Paragonid opened 8 years ago

Paragonid commented 8 years ago

Hello, I would like to display date and time pickers simultaneously, i.e. you don't have button to switch between 'date' and 'time' modes.

Do you think there's an easy way to archive this?

Gillardo commented 8 years ago

U could probably do it with 2 datetime pickers, 1 showing the date and 1 showing the time, each one bound to a different model. Then use a watch to watch the values and add the date from one and the time from the other to make your actually datetime value....

EDIT Both pickers would use the same isOpen variable to show them in an open state

Gillardo commented 8 years ago

Else you would have to hack the code

Paragonid commented 8 years ago

Thanks for idea, I'll post my solution here.

Paragonid commented 8 years ago

@Gillardo, I think it's working well if I just delete mode conditions in templates: in 'template/date-picker.html' (and same for 'template/time-picker.html'): "<ul class=\"dropdown-menu dropdown-menu-left datetime-picker-dropdown\" ng-if=\"isOpen && showPicker == 'date'\" ... by deleting && showPicker == 'date' change to "<ul class=\"dropdown-menu dropdown-menu-left datetime-picker-dropdown\" ng-if=\"isOpen\" ...

The rest of the work is adjusting styles which I'm not experienced with. But I see how this might be an optional mode for datetime picker to display both pickers in the same time.

So what I say is the only change seems to be required is slight modification of templates. Am I able to pass custom template for datetime picker somehow?

Paragonid commented 8 years ago

Another option is to extend condition to something like ng-if=\"isOpen && (showPicker == 'date' || showPicker == 'both')\"

Gillardo commented 8 years ago

Could support option for both. Maybe a nice feature to have. Do u show the pickers next to each other or one under the other? On 12 May 2016 10:03 a.m., "Vladislav Derbenev" notifications@github.com wrote:

Another option is to extend condition to something like ng-if=\"isOpen && (showPicker == 'date' || showPicker = 'both')\"

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/Gillardo/bootstrap-ui-datetime-picker/issues/122#issuecomment-218700221

Paragonid commented 8 years ago

It's going to look like this for me simultaneous datetimepicker And yes I know about lack of buttons ):

Gillardo commented 8 years ago

Love ur look. Could u send me ur sass/css for this look pls? On 12 May 2016 15:37, "Vladislav Derbenev" notifications@github.com wrote:

It's going to look like this for me [image: simultaneous datetimepicker] https://camo.githubusercontent.com/2fe607b2336c6831f145e741512f69ff764ea84c/687474703a2f2f692e696d6775722e636f6d2f444a55344871722e706e67 And yes I know about luck of buttons ):

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/Gillardo/bootstrap-ui-datetime-picker/issues/122#issuecomment-218777340

Paragonid commented 8 years ago

I found a problem with my solution to display timepicker alongside with datepicker: model is being updated only once for datepicker. Pressing date after first change, doesn't change anything before you close and reopen datetimepicker. I will look into it, but advice me if you know where to search exactly. I have .scss for our project I can share, but it's pretty specific and our designer said it might be easier to create new one instead. I'll post it on Monday

kyse commented 8 years ago

Would love to see this become a reality. Let me know if you need help.

Paragonid commented 8 years ago

I'm still going to make it happen, but I has been pulled away from working on this lately. I've described everything I know at this moment and will keep doing it.

Gillardo commented 8 years ago

@Paragonid I am sorry but i am bogged under at the moment. I will look at this as soon as i can. Let me know when you upload your .scss styling please, as that looks really nice!

Andygmb commented 7 years ago

@Paragonid @Gillardo Any updates on this?