Is there a way to add a "Go to today" to a JavaFX DatePicker? - datepicker

The title says it all: I have a JavaFX DatePicker and am looking for a way to add a button which, upon a click to it, goes to the current date or at least the current month.
Is there a way to do this?
BTW, I'd like to have this button inside the DatePicker, maybe above the month calendar.
Do I have to modify the skin?

I believe this would work for you
datePicker.setValue(LocalDate.now());
Inside the button action function you can add this code to set the datepicker to the local date

Related

JDatePicker calendar not showing up when clicking on the button - no button action code is being run

I implemented JDatePicker exactly according to the post below. It was working fine for the longest time, but recently when I tried to click on the button to change the date, it doesn't seem like the button is recognizing the action and the calendar window isn't displayed. I added an ActionListener to the date picker to test this, and the code is not being run. I have additional buttons that will change the date by one day earlier or later, and those will likewise update the calendar model in the label of the date picker as advertised.
The problem is only occurring in my main class; if I add it to another class, it works fine. I've tried different implementations of it, but with no luck. All my other buttons in the frame function normally, it just seems to be isolated to this one component.
What would cause it to not function?
How do I implement JDatePicker

SAPUI5 DateTimeInput open by Button

I'm using a sap.m.DateTimeInput in my XML View. When the input is clicked the DatePicker Popup is opened. Now I want to add a Button beside the DateTimeInput, and let open the Date popup on button click. DateTimeInput provides no method to open the Popup as far as i know. I'using SAPUI5 version 1.28.
How can i achieve this ?
I'm a little bit lost in Borwser Events, handlers and so on.
Check out the Date Picker control. I think that this control is what you want.
Date Picker Control

Datepicker opened by "show()" function need a click

I Have 2 datepicker (checkin and checkout date). When the user select the first date, my script open automatically the second datepicker, through
$("#checkout").datepicker('show');
ok.
My problem is that in this second calendar, when the user click on right arrow to change the month, the calendar is closed (1 second) and re-opened. So, the user must click twice for change month.
How I can solve it?
Thanks!

Can I block a button?

I have a DatePicker() and button in a ControlView, when I click on the button it jump to a function where i work with the date i choose in the DatePicker(which spins), the problem is while is datePicker spining and i click the button it doesn't choose the date and it jump to function without choosing the date. Is posibble while is spining the datepicker to block the button?Or it can be another way?
Thanks for answers
The UIDatePicker control will send an action method when the user has finished rotating the control (for the event UIControlEventValueChanged). You could use this action method to enable the button so that the button can only be pressed after the user has completed picking a date.
See docs:
When properly configured, a UIDatePicker object sends an action
message when a user finishes rotating one of the wheels to change the
date or time; the associated control event is
UIControlEventValueChanged.

UI Design for UIDatePicker in iOS

I have experience in Android and currently started to learn iOS. I created a mechanism to Pick data in an Android App. When I click on Date button, a DatePicker pops up:
As you see It has Cancel and Set button.
My question is about my iphone App. I want to have the same mechanism. When I click on the button, Date picker pops up (that can have Set and cancel button like Android Date picker). How can I do that? I'm not sure that it is a good way in iPhone, Can you help me if we can design a better mechanism?
Here's a UX comparison between Android and iOS standard widgets, with links to the documentation on the relevant Apple / Android websites. It's a nice way to get started learning all the technical terms.
http://kintek.com.au/blog/portkit-ux-metaphor-equivalents-for-ios-6-and-android-4/
Hopefully that gets you started.
Apple has a sample project that demonstrates this. You'll have to adapt it slightly: instead of showing/hiding the date picker itself, you'll want to show/hide a view containing a date picker and a dismissal button.
It's called DateCell.
Basically, it treats the date picker as if it were the keyboard for a cell containing the date. You'll need to manage hiding it when the user enters a text field (and thus, needs the real keyboard) and scrolling to keep the date row in view, but all the bits you need are in this project one way or the other.
One way to do it would be add a custom buttons to the same view containing date picker and then pop it up when the users wants. Instead of using the date picker delegate use the buttons action to get the date picker value.