I'm using JXDatePicker for displaying and selecting Date and Time.
But I want to set the Date and Time to the current Date and time. Setting Date works, but I can't find a way to set a time, please help if someone knows this.
Right now my code looks like this:
jXDatePicker.setFormats("dd-MM-yyyy hh:mm a"); //This displays current Date and 12:00 AM always
jXDatePicker.setDate(Calendar.getInstance().getTime()); //I have tried other things as well instead of this, but nothing seems to work.
Related
I would like the DateField to be defaulted to my user's timezone. I've tried DateField.setZoneId() but this really didn't seem to do anything. I then tried to do DateField.setDefaultValue(LocalDateAdjustedForTimeZone) which mostly worked in that the blue box was correctly highlighted but the black outline remained under the server's timezone.
As far as I can see in the Vaadin client component VAbstractCalendarPanel#buildCalendarBody(), there's no way to influence which day is marked with the today CSS style v-datefield-calendarpanel-day-today. The client component Java code about determining "today" looks like:
final Date tmp = new Date();
final Date today = new Date(tmp.getYear(), tmp.getMonth(), tmp.getDate());
So I guess when it's translated to JavaScript it will take the current date on the browser's system.
However, as a workaround you can at least adapt the CSS styles to hide the today marker. I wonder why Vaadin did not think about your use case (which is mine, too). Can you open an issue at Vaadin please?
I have a form on which I want to access a date from the database and show in jDateChooser for a particular record. How do I get the date from the database table and how do I set that date in jDateChooser? The datatype on my database is date.
JDateChooser.setText(a.getValueAt(selectedRowIndex, 5).toString());
this is my code and it produces error.
First what is "a"? For the looks It seems to be a Table(?)
By JDateChooser you mean the netbeans plugin? or the JDateChooser from Toedter? or anything else?
You really should provide a mcve
If you have a JDateChooser from Toedter then you can use something like
JDateChooser.setDate(<Date_from_DB>)
With this little info I can't help you more
Date picker has a calendar that pops up when clicked on. Is it possible to only use the calendar that displays? If so how?
I just want to display a calendar that shows info for each date. I'm pretty new to JAVA FX.
EDIT: I kinda want something like a "CalendarView". Where I can edit content etc.
For example if I only want it to show ranges from 9am to 9pm? displayedCalendar property doesn't seem to change anything, only changed the displayed date.
Is this possible?
Right now there is only a week and day skin, showing both 24 hours. So the answer is: not at the moment.
I've got a DateTime (SWT.TIME) and want to know if the hours or minutes or seconds are selected.
I would like to get this information because I want that the User can scroll the mouse wheel in order to change the selected values accordingly.
Unfortunately I couldn't find any way to get the selected element of the DateTime Control. Does anybody have an idea?
DateTime provides many methods for getting the selected date. Like getHours, getMinutes, getDay, and so on. It's unclear to me what's your exact question, but appropiate setters are there as well.