QML calendar not working with S4 - qml

I have tried my app in Samsung Galaxy S4 and for some reason the calendar doesn't open in the correct day and the Month at the top doesn't show the correct month.
It works in my laptop and also in my Nexus4. Therefore, it seems to be a problem with the Galaxy phones.
Any suggestions to fix this problem? Has anyone had this problem before?
This is the code I'm testing:
-- DatePicker.qml
...
property date p_date
Calendar {
anchors.fill: parent
minimumDate: 1950
maximumDate: 2050
selectedDate: p_date
onClicked: {
p_date=selectedDate
accepted()
stack.pop()
}
}
-- Form.qml
...
onClicked: {stack.push(id_dialogDate)}
...
Component {
id: id_dialogDate
DatePicker {}
}
The expected output when DatePicker is opened should show the Calendar in the correct month with the chosen date highlighted. Say for instance I'm opening the Calendar choosing 22/March/15:
The result is:
![][1]
The Month is correct at the top, but the calendar is really showing February. Look at the last day of the month: 28
Now when I click and jump to the next month, it shows:
![][2]
The month is showing April at the top, but the calendar is really showing March and the date I chose 22/March is highlighted.
Any suggestion?
Note: I couldn't attached the screenshots. The system ask me for 10 reputation points :(.

Related

How to select month and date from the popup datepicker in karate [duplicate]

This question already has answers here:
Karate Mobile - Is there a way in Karate to perform TouchActions or scrollIntoView
(2 answers)
Closed 1 year ago.
I'm working on a project to automate a mobile application using karate and appium. I'm able to select the very next/previous three months and next/previous three dates from the popup date picker using normal click(). E.g. I'm able to select the previous 3 months like Mar, Feb, and Jan w.r.t the current/default month(i.e. Apr) and was able to select the next three months May, June, and July w.r.t the current/default month(i.e. Apr). similarly I'm able to select the previous dates like 29, 28, and 27 w.r.t the current/default date(i.e. 30). Now I'm facing an issue when I try to select a month other than those 3 months and the same issue with the date too. It throws an error saying "Element could not be located"
FYI - In the dom I'm able to inspect all the month and date elements
I even tried with the following code, it isn't working it's failing to locate the element.
And mouse().move('//XCUIElementTypeButton[#label="Apr"]', '//XCUIElementTypeButton[#label="Oct"]').go()
Kindly correct me if I'm wrong, I doubt that since not all the months and dates are visible on the UI side, so they must be hidden and the tests are failing to locate those hidden elements.
Would like to request you to provide your inputs/opinion on this issue.
Typically iOS date picker can be handled in 2 ways
Both involve identifying each date picker wheel uniquely without a label (ie. locator shouldn't have date/month/year values)
option 1:
calling input() in karate and pass the value you want to select
* driver.input(<Locator>, "Oct")
option 2:
calling mobile command in appium via script() in karate
* def datePickerId = driver.elementId(<Locator>)
* def arguments = {"order": "next", "offset": 0.15, "element": "#(datePickerId)"}
* driver.script("mobile: selectPickerWheelValue", arguments)
refer : https://github.com/appium/appium-xcuitest-driver#mobile-selectpickerwheelvalue

Dynamically assign the text content of a certain day in react-native-calendars

eg. when I click the date “ March, 7th ” ,the text “21 days” will appear on 21 days later date in calendar instead of "March,28th”.
You probably should create a new Day Component for what you need.
You can create a new Day Component inside the react native calendar: react-native-calendars/src/calendar/day/
You can create a new Day Component using the API of the react native calendar, check the documentation for it here https://github.com/wix/react-native-calendars#overriding-day-component:
dayComponent={({date, state}) => {
return (customDayComponent);
}}
Or without day component you will have to get the left and top position of the needed day and place an overlaying View over the day (position: 'absolute', zIndex: 1).

DatePickerIOS in react-native and user locale

We've implemented DatePickerIOS from react-native but it doesn't seem to respect the device locale for dates.
I'm in Norway right now, and it is correctly showing a 24 hour picker without AM/PM, but the text still says "Today", "Thu 5 Oct", "Fri 6 Oct". It should be more like "I dag", "Tor 5 Okt", "Fre 6 Okt"
RN version 0.47.1
open 'Info.plist' file in 'ios' folder using Xcode or other text editors, change 'CFBundleDevelopmentRegion' to your locale's name, then retry

Dojox mobile date picker with minimum year (do not show year that less than current year)

Is there any properties can set the dojox.mobile.datePicker year entry to only show current year and onwards?
Thanks.
You could use the labelFrom and labelTo properties in the slotProps. Both properties are mandatory or the picker won't show any year at all.
<div id="myDatePicker" data-dojo-type="dojox/mobile/DatePicker"
data-dojo-props="slotProps:[{labelFrom: 2015, labelTo: 2025},{},{}]"></div>
regards,
Stijn

Dojo popup date picker

how do i make up the popup datepicker in dojo which should have seperate dropdown box for year,month..?
I dont think there is a date picker with separate year and month drop downs... I use dojo DateTextBox. The implementation is simple...
require(‘dijit.form.DateTextBox’);
<input type=”text” dojoType=”dijit.form.DateTextBox” name=”date” id=”date”/>
And why would you want separate year and month selectors when its easier for the user to select date from a calendar??? You can take out any part of the date on server side as you please once it is posted....
#Black Rider - it's better if you disable the ability for users to type in a date field. This way, you don't have to worry about validation if they just can select a date from the date picker.
I've had applications where users would need to select a date from many years in the past, e.g. 2002 or even the late nineties. What if you have an app where someone has to enter their birthday?
You could use a jQuery date picker instead, where you can easily add the year.
What Black Rider said is true (and DateTextBox is a great widget), HOWEVER there are also "mobile" dojo widgets that have what you are looking for:
1) "ValuePickerDatePicker" - http://dojotoolkit.org/reference-guide/1.9/dojox/mobile/ValuePickerDatePicker.html#dojox-mobile-valuepickerdatepicker
2) "SpinWheelDatePicker" (very iPhone-y) - http://dojotoolkit.org/reference-guide/1.9/dojox/mobile/SpinWheelDatePicker.html#dojox-mobile-spinwheeldatepicker