QML Charts - DateTimeAxis UTC Time - qt

I am using in QML a ChartView with a LineSeries where on the axisX is used a DateTimeAxis. And I have noticed that 'min' and 'max' properties of DateTimeAxis are displayed based on the locale settings.
That means the time shown in the time axis is always at the current locale but it would be helpful in some cases to be in UTC.
Somehow, it should be possible to show the time on DateTimeAxis in UTC format, but how is that possible?

Related

Using react-google-charts, how do I format hAxis labels for a timeline in a different timezone

Using react-google-charts, I have a timeline chart display a range of datetime values, but I need to label the hAxis using a different timezone. User is looking at data for an account in another timezone and they want to see the account timezone not their local timezone.
I have searched several times but can't seem to find an answer though this does not seem like a very unusual requirement.
is there a way to define a custom formatter function as opposed to just a format pattern on the hAxis?

Fullcalendar plot error

may I ask and need your help also. I am using a full calendar plugin latest version of v3.8.0. I create an event which is the start date is 2018-01-16 23:59:00 and the end date is 2018-01-17 08:00:00 (11:59pm - 8:00am) . The event is plotted only on 1 box which is the day of 16, but when is set it at 2018-01-16 23:59:00 and the end date is 2018-01-17 09:00:00 (11:59pm - 9:00am) the result is set 2 box from 16-17 day.I'm having a hard time on setting this time format for this plugin.
I assume you're talking about the "month" type of view, because this is the only situation where this behaviour occurs. It doesn't make any logical sense in the other view types.
Anyway, this behaviour is controlled by the nextDayThreshold setting. When an event's end time spans into another day, this option controls minimum end time it must have in order for it to be rendered onto that day. The default value is 9am
This can be useful if you have an event which ends in the early hours (e.g. a party) but you don't want people to confused into thinking it takes place the next evening, or runs over into the normal working day or something.
In your case, if you wanted your event to appear, you could set the threshold earlier, for example 7am, in order to change the behaviour:
nextDayThreshold: '07:00:00'
Here are two working demos showing you the difference when you change the threshold:
Default behaviour:
http://jsfiddle.net/sbxpv25p/93/
With nextDayThreshold set to 7am:
http://jsfiddle.net/sbxpv25p/94/
See https://fullcalendar.io/docs/event_rendering/nextDayThreshold/ for more detail about this option.

Set hour format in schedules - AgendaDay view in FullCalendar.js

I'm working a medical scheduler made in Fullcalendar.Js plugin. I'm trying to set the next visual detail:
I've got the default hour format for each row in this sample image:
Is there any format type not only shows the o'clock hour by default, but also shows the respective hour for each row? i.e. 5 pm; 5:20 pm; 5:40 pm, etc.
I need something like this:
To get that effect you need to set the slotDuration to a smaller value, e.g.
slotDuration: "00:40"
See this example: http://jsfiddle.net/sbxpv25p/64/
Docs: https://fullcalendar.io/docs/agenda/slotDuration/

QML Date -- Storage and locale-based display

How would you recommend to store a date in a database? As milliseconds? In a QML application, I can easily get this by the Date.now() function. However, if the date is stored as milliseconds, how could I go about displaying the date, using some of the functions of the Date QML type? This seems to be shrouded by mystery to me at this minute. I would prefer the date to be printed locale-sensitively, so that different users in different countries get the culture-specific formatting.
Ok, it was pretty simple. I guess it is ok to store the date as milliseconds, as you can simply create a new Date object from that in QML. The locale formatting functions have couple of easy variants for printing both date and time separately:
Text {
...
property var dateOf: new Date(myTimeInMilliseconds)
text: dateOf.toLocaleDateString() + " " + dateOf.toLocaleTimeString()
}

Custom date list in QDateEdit using pyqt

I am using QDateEdit widget to get the user selected date from the calender (popup). However, I want to allow the user to pick dates from a list of specific dates (highlighted on the calender) and not just any date. I see that using setMinimumDate and setMaximumDate the dates outside the the specified range gets grayed out and hence cannot be selected -- this is exactly what I want but not for a range but for a list of specific dates.
Any ideas?
Subclass QCalendarWidget and use QDateTimeEdit::setCalendarWidget to set it as the widget to be used for the calendar pop-up.

Resources