Problem with dates

Discussion of the version of HanDBase that runs on the iPhone and iPod touch devices. This includes the synchronization conduits as well.

Problem with dates

Postby Publi-Script » Tue Oct 29, 2013 5:10 am

Hi,

I just upgraded my iPhone 3GS to 5S and I can observe the following ever since:
Image
As you can see (Starting at the shaded entry) my dates do not display in the same way which screws up my sorting.

How can I fix this?
Publi-Script
 
Posts: 12
Joined: Sat Oct 23, 2010 7:45 pm

Re: Problem with dates

Postby dhaupert » Tue Oct 29, 2013 10:17 am

Hi there,

Thanks for your post. What is the field type of that Week field? Is it truly a date field or is it a text, calculated, or something else? I ask because we format the date field on the fly (it's stored in days since 1/1/1904) so it is always formatted based on the system preference you have set for how dates are shown. It should never be inconsistent like this which makes me wonder if they are truly date fields or not.

If you are able to send me the database, I can just take a look and see what could be going on! My email is below..
dhaupert
 
Posts: 4111
Joined: Tue May 26, 2009 11:51 am

Re: Problem with dates

Postby Publi-Script » Tue Oct 29, 2013 4:33 pm

That field is a DB Popup field where the popup field is a calculated field using the formula: (Start+0) in Date Format where Start is a DATE field.
Publi-Script
 
Posts: 12
Joined: Sat Oct 23, 2010 7:45 pm

Re: Problem with dates

Postby Brian_Houghton » Tue Oct 29, 2013 10:27 pm

Publi-Script wrote:That field is a DB Popup field where the popup field is a calculated field using the formula: (Start+0) in Date Format where Start is a DATE field.


Hello,

Thanks for sharing. Are you using the same regional settings on the new iPhone as what you used on the old iPhone? If you are, the date formatting should have remained the same.

Sent from my Nexus 7 using Tapatalk HD
Kind Regards,
Brian Houghton, DDH Software
Brian_Houghton
 
Posts: 2246
Joined: Wed May 20, 2009 8:30 am

Re: Problem with dates

Postby Publi-Script » Tue Oct 29, 2013 11:14 pm

Brian_Houghton wrote:
Publi-Script wrote:... Are you using the same regional settings on the new iPhone as what you used on the old iPhone? If you are, the date formatting should have remained the same.


I think I am... Nevertheless, this would mean that dates are not stored as dates but rather as formatted text... Otherwise, changing my settings would change the format on all my dates, not only the last one I created.
Publi-Script
 
Posts: 12
Joined: Sat Oct 23, 2010 7:45 pm

Re: Problem with dates

Postby dhaupert » Wed Oct 30, 2013 7:05 am

Hi there,

Thanks for sending the database and your followup. The date and time fields are automatically formatted on the fly based on regional settings. The field you're showing a screenshot of however, is a DB Popup field. A DB Popup field is a text field that can copy the value from any other field of another database. In this case, your other database Weeks has date and calculated fields for dates, and that is the one that is going to be auto-formatted based on your regional settings. So anything in the Work Schedule database is just a text copy of whatever was selected in the Weeks database. If the formatting changes for dates, the Weeks database will be reformatted, but it doesn't change any of the text in the DB Popup field of the Work Schedule database.

If you go to the General, International section you should be able to choose your region settings- perhaps this is different than what it was before. I believe the current format you are showing for newer dates is the US format and what a device bought in the US would default to. Maybe you had it set to something else prior?
dhaupert
 
Posts: 4111
Joined: Tue May 26, 2009 11:51 am

Re: Problem with dates

Postby Publi-Script » Wed Oct 30, 2013 1:58 pm

thnak you for your reply,

unfortunately, that ain't it... I fired up my old phone and sure the International/regional settings are the same on both... I even tried creating a new records in my old DB and it appears as it should.
The only thing different seems to be the iOS version (6.1.3 vs 7.0.2). HanDBase version on both phone is 4.9.03.
Publi-Script
 
Posts: 12
Joined: Sat Oct 23, 2010 7:45 pm

Re: Problem with dates

Postby Publi-Script » Sat Nov 02, 2013 2:55 am

So I guess ther are nos response to this...

That said, is there a way to force all my records to recalculate their fields under the new environment?

TIA
Publi-Script
 
Posts: 12
Joined: Sat Oct 23, 2010 7:45 pm

Re: Problem with dates

Postby dhaupert » Sat Nov 02, 2013 6:13 am

Hi,

A recalculate wouldn't help, because the text field is copied over to the main database, and a recalc would just keep things the way they are. If you recalc the DB Popup database, the dates should adjust accordingly. You may have to open the first record, tap Edit, and then tap the > arrow. Repeat for all records to get them up to date.

But then any records you bring over to the main database would have to be reselected as well to find the newly adjusted value. Sorry there isn't a better way!
dhaupert
 
Posts: 4111
Joined: Tue May 26, 2009 11:51 am

Re: Problem with dates

Postby Publi-Script » Sun Nov 10, 2013 3:39 am

Well, I finally got it sorted out but what a nuisance this proved out to be...

As suggested, I updated each records manually only to find out that I did all this for nothing. The reason being that dates (stored as text) do not sort chronologically, this due to the odd way dates are written down in English (Month/Day/Year) and the fact that, stored as text, numbers do not sort properly (1, 10, 11, 2, 20, 21, 3, ...).

So I tried creating an index field instead (auto increment by 1) but since I could not specify a starting number, I was faced with the same problem stated above: Numbers stored as text do not sort properly.

I ended up using my original calculated field but storing it as integer rather then date. This produced a 4 digit number that, for the time being, sorts properly. This, of course, will break when that number reaches 5 digits (whenever that is).

In short, we need better options for dealing with these issues:
  • Date formats
  • Auto Increment Options
  • Popup Values that retain their data types
  • Better way to update Database Popup fields
Publi-Script
 
Posts: 12
Joined: Sat Oct 23, 2010 7:45 pm

Next

Return to HanDBase for iPhone and iPod touch

Who is online

Users browsing this forum: No registered users and 2 guests

cron