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.
Related
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.
I am little bit stuck and don't know to do. I have a Calendar View and wanna to change the color of day of week dynamically, in my case need to handle click on day of week. Below image what I am mean (sorry have only Russian version of example):
In above screenshot selected Tuesday an Thursday (week starts from Monday).
it seems like it is not quite possible. when you analyze the source code of SimpleMonthView which is the view used in CalendarView to draw each month, you can see that there is a stateMask (VIEW_STATE_ACTIVATED, VIEW_STATE_PRESSED) for days of Month but there isn't any stateMask for days of the week.
I would recommend to draw custom days of week view and overlap it with calendar view. I know it is not best solution
My question is this: Is there a solution to bekome a DatePicker with only the month and year without days? Since a standard DatePuicker works with Java LocalDate it does not seems so simple...
One of the options is to make the text field with a mask through regex, but then the "Picker" would be lost, that I would like to leave. Has somebody already faced with this?
Thanks in advance!
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.
I want to implement a date chooser using a JSlider. The user should be able to use the slider to freely choose between two previously known dates. I've seen examples like this one:
But I want to do the same, using only one slider. The minimal distance between two points (tick) should be one day. Any hints how to implement that?
If you want to have a slider with min = 1.1.2012 and max = 10.1.2012 just create a slider with min = 0 and max = number of days in between, then add the selected number to 1.1.2012.
I assume 10.1.2012 means January 10th, thus your slider would have min = 0 and max = 9. Then set the labels accordingly.
I can't to image how to do that with one JSlider, because there you'd have bunch of days, there are some workarounds for Double/RangeSlider, but I think better and easiest would be implements JSpinner with SpinnerDateModel, or best options is look for Custom Java Calendar or DatePicker
EDIT (#Robin)
First to answer your question: you can just use a JSlider, use the number of days between your start and end date to determine the range, and use custom labels (by using for example the setLabelTable method)
Now for user-friendliness, avoid this since
Nobody is familiar with this concept. Every site/application nowadays uses a textfield, most of the time in combination with a calendar widget. That is what users expect, not a slider
It will be hard to get all dates as labels on the slider due to the limited width. This means that a user have to interpolate / count to select his correct date
If you stick to the slider approach, at least consider to add a textfield as well. Even a non-editable text field which shows the currently selected date would be a huge improvement over a slider (see point 2)