Comments (17)
Show me some code. :-)
from jfxtras.
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"), Locale.US);
calendar.setTimeInMillis(DateTimeDialog.getInstance().getTimeToSet());
mCalendarPicker.setCalendar(calendar);
from jfxtras.
from jfxtras.
thanks 4 help dude
from jfxtras.
You are setting a time in the calendar in the second line, no idea what value that is.
But, CalendarPicker is not doing anything with time zones, it uses merely a locale to get the day names right. It just renders the day, month, year, hour, minute, seconds that are in the calendar. Very curious what this line inserted before the setCalendar gives as a result:
System.out.println(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS").format(calendar.getTime()));
from jfxtras.
as u can see in the photos above, the clock starts from 2 and ends to 1:59. That seems a bug to me since it must start from 0 and end to 23:59
from jfxtras.
ohhhh, I see!
from jfxtras.
It happens when i switch the calendar from default to UTC and set it to CalendarPicker.
from jfxtras.
Indeed. Interesting. I can reproduce it now.
from jfxtras.
so when i should expect a patch? :))
from jfxtras.
This is open source, so never :-) But I am looking into it now
from jfxtras.
So the cause is in calendar, but I have to think about why. If you execute this code:
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"), Locale.US);
System.out.println("H1=" + calendar.get(Calendar.HOUR_OF_DAY) + " / " + new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS").format(calendar.getTime()));
Calendar calendar2 = Calendar.getInstance();
System.out.println("H2=" + calendar2.get(Calendar.HOUR_OF_DAY) + " / " + new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS").format(calendar2.getTime()));
I get this output (its just after noon here):
H1=11 / 2018-12-28T12:14:45.468
H2=12 / 2018-12-28T12:14:45.476
What you see if that they format into the same time (12 o'clock), but if you query for the 24-hour value, they differ.
from jfxtras.
that s strange indeed. I figured a workaround for me, i get the default time in millis then i extract the timezone raw offset, It works.
from jfxtras.
The formatter uses Date, which is not timezone aware, and thus always renders in the current timezone. The hour of day returns the value in the current timezone. Have to thing about how to solve this best, because date and time picking is done timezone unaware.
from jfxtras.
I think I have fixed it, but the release needs to pass all tests first. It is a fairly large change.
from jfxtras.
i see
from jfxtras.
I assume you're still using Java 8? Give 8-r7-SNAPSHOT a try please
from jfxtras.
Related Issues (20)
- Agenda hours HOT 1
- JFxtras UI bug when try to switch skin into day view and week view HOT 3
- JFXtras not building HOT 1
- Module trouble with VFXWindows-samples HOT 1
- Broken versioning in Maven Central HOT 1
- NullPointerException when parsing VCalendar HOT 1
- Microsoft Outlook use different time zone id's HOT 6
- DateTimePicker in Vbox with Hgrow not working HOT 3
- NullPointerException when opening advance edit or edit on already created event.
- Exception with HOT 7
- how can use gsls shader in javafx? HOT 1
- how to use JFxtras with Scenebuilder on Netbeans 8.2? HOT 1
- Maven jfxtras-test-support Test Scope HOT 10
- Minor - Broken link
- Release JFXtras built on JavaFX 17 HOT 1
- incorrect link HOT 2
- JMetro dark theme with localDateTimeTextField barely readable HOT 4
- Agenda with specific hour range HOT 3
- Agenda display appointment
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jfxtras.