Developing Smart Mobile Studio was a lot of fun last week. We solved two pet peeves in the IDE and improved the Object Inspector. Ever wondered why we couldn’t use the Delete-button in the Search dialog? Or why the Internal Debugger always had to be closed before clicking Execute again? Well, no need to wonder any more – they are fixed now.
In the RTL my all time most frustrating bug in Smart Mobile Studio was also fixed: The way TDateTime worked. As most of you know, TDateTime is a float where the integer part represents the day and fractions the time of the day. So, when you do a EncodeDate(2018,12,1) in Delphi, you get a simple integer: 43435. However, in Smart Mobile Studio, you got a value anywhere between 43434.5 to 43435.5. When you built a time with EncodeTime(8,0,0,0) and wrote it out with TimeToStr(), you didn’t get 8:00:00. Where I live, I got 12:00:00. That’s because the underlying javascript date functions, that the compiler used, built the date in UTC but viewed the time from the time zone where you ran the program. If you Google for date handling in javascript, you’ll find countless pages where js programmers are struggling with these as well.
When I joined the development team more than a year ago, I wanted this fixed yesterday, but it wasn’t simple. I was told that we’d need to upgrade to a newer version of DWScript, which was not an easy task. However, it turned out that the upgrade was not necessary. So last week I went through all the date and time handling functions in DWScript and fixed this for good.
To get all the latest fixes and updates, do follow this forum post. We opened up the DEVELOPMENT-channel in SmartUpdate, so all our users can get fresh updates right away.