Test different calendars on iOS - ios

I have an app that relies heavily on date calculations. I am using NSCalendar and doing all the calculations "the right way", but I don't really have any way to test any other calendar besides the default US one.
How can you change the calendar used on iOS? Where can I find more information about calendar alternatives?

You can simply change it on your Device/Simulator. Open Settings -> General -> International. Here you can change the format of the calendar date or the calendar itself.

Related

Extracting universal time/atomic time in flutter

I am working on a demo app in a flutter in which I want universal date time. I am using DateTime.now() but it's giving me devise date and time. Is there any way to get standard/universal date time(America) irrespective of device date-time setup. I want that date-time fetched offline without any connectivity with the internet.
To get universal time use
DateTime.now().toUtc()
to get local time use
someDate.toLocal()
There is no support to getting DateTime for a specific locale other than the one your device is located in (configured).
There is at least one package in pub.dartlang.org that provides such a feature though.
https://pub.dartlang.org/packages/time_machine looks like it does, but I haven't used it myself yet.

Force TMonthCalendar to display user defined date format

By default TMonthCalendar shows date in the format that is set in Windows control panel (Short Date). I want to override this setting and force TMonthCalendar to always display my format regardless of Windows setting. Is it possible ?
As far as I know, you can not change the date format settings of TMonthCalendar.
The reason for this is the fact that TMonthCalendar is actually just a wrapper around a calendar API from the OS. That is why not only is the date format in the form that is set in OS regional settings, but the whole look of the calendar matches the look of the OS on which you are running your application on.
So, I'm afraid you will have to look at some third party components for this. For instance, TMS Software has several calendar and date-time picking components as part of TPlannerCalendar.
No, this control is a wrapper for the native Month Calendar Control. As the documentation states:
The month-calendar control gets its format and all strings from
LOCALE_USER_DEFAULT.

I want to change the datepicker for my mobile website on iOS

Currently the datepickers trigger the default iOS datepicker with dd-mm-yyyy format. I would like it to trigger the dddd-dd-mm-yyyy format so users are better at picking the correct date because they can see the actual day of the week.
Is this possible for a mobile website?
I'm not sure about doing it for mobile website. But we can change format of default iOS date picker if you want. It's directly not possible through date picker. There is another component called UIPickerView in iOS, through which we can achieve this. Check how to create UIPickerView for mobile website and place the values you want in pickerView.
So after doing more research on the subject I have found that it is possible to use datetime-local. This triggers the native datepicker with ddd-dd-mm format but also accounts for the year (so scrolling over december 31 will make the date object move to the next year). This workaround has issues with IE though, so is not a universal solution.

Check if date is correct in IOS

Currently, I am grabbing the current date by NSDate().timeIntervalSince1970. However, I am concerned that the user will change the date on the phone to mess with my app. So I was wondering which of the two options below is a more suitable fix
Is there some sort of Apple way to grab the current date from an apple server.
Is there a good and reliable API where I can grab current date?
Use the TIMEAPI available at www.timeapi.org
You can retrieve the current time in UTC here.

How do I get list of calendar app data?

For example:
I would like to access all my calendar data (default iOS App) which has user embedded data on
Start date 11/11/2013 10:00 AM with Title "Meeting w/ Australian".
Or another one,
Start date 1/1/2012 08:00 AM with Title "2012 New Year's Party".
How do I access these and put them on NSMutableArray?
Can someone help me here?
Given the quarantine-like protection built in IPhone apps, I bet you won't be able to access the info, I've never tried personally but I'm willing to bet on it.
thats probably why all the calendar apps start empty.
I would look at exporting Ical to CSV then parsing it ingot he app as a hacky way to get around it.
Good luck though.

Resources