Hi again. I have one screen where no matter what I do, the date will not format correctly. I've stuck SetDateFormat, SetDateCountry and SetInternational all over the place trying to get it to work, and nothing makes any difference. I've wasted hours on it. Below are images displaying the correct format, and another where the date is incorrect. The incorrect screen is called by pressing the "List Jobs" Button. This is the code:
METHOD ListJobsButton( ) CLASS JobInfo
Local oRecord as string
SetDateFormat("dd/MM/yyyy")
SetInternational(#Clipper)
oRecord := self:Server:FIELDGET(#CLCODE)
If self:oSFJobInfo_DETAIL:CurrentView == #FormView
self:oCCListJobsButton:Caption := "View Record"
self:oSFJobInfo_DETAIL:Server:OrderScope(TOPSCOPE, oRecord)
self:oSFJobInfo_DETAIL:Server:OrderScope(BOTTOMSCOPE, oRecord)
self:oSFJobInfo_DETAIL:GoTop()
self:oSFJobInfo_DETAIL:ViewTable()
ELSE
self:oSFJobInfo_DETAIL:ViewForm()
self:oCCListJobsButton:Caption := "List Jobs [F4]"
END IF
RETURN self
The properties for the window are attached as is the Fieldspec for the problem field. Any ideas would be greatfully received. Thanks
Date issue - extremely frustrating!
Date issue - extremely frustrating!
- Attachments
-
- Date Correct.png (63.96 KiB) Viewed 722 times
-
- Date Incorrect.png (40.65 KiB) Viewed 722 times
-
- JobDate Properties.png (52.27 KiB) Viewed 722 times
-
- FieldSpec.png (20.02 KiB) Viewed 722 times
Date issue - extremely frustrating!
Looks strange! As if the DataBrowser is not respecting the SetDateFormat.
It's been a long time since I used DataBrowser (I now use bBrowser), but I think you can get better control if you use the DataColumn class to create the data columns. Something like this (not tested):
LOCAL oColumn AS DataColumn
LOCAL oServer AS DbServer
oServer := DbServer{"yourserver.dbf"}
SELF:use(oServer )
SELF:Browser := oSFJobInfo_DETAIL{SELF}
oColumn := DataColumn{}
oColumn :width := 15
oColumn :HyperLabel:= HyperLabel{#JOBDATE}
oColumn:Caption := "Job Date"
oColumn:FieldSpec := DateFS{} // your fieldspec
SELF:browser:addColumn(oColumn )
SELF:ViewAs(#BrowseView)
Jamal
It's been a long time since I used DataBrowser (I now use bBrowser), but I think you can get better control if you use the DataColumn class to create the data columns. Something like this (not tested):
LOCAL oColumn AS DataColumn
LOCAL oServer AS DbServer
oServer := DbServer{"yourserver.dbf"}
SELF:use(oServer )
SELF:Browser := oSFJobInfo_DETAIL{SELF}
oColumn := DataColumn{}
oColumn :width := 15
oColumn :HyperLabel:= HyperLabel{#JOBDATE}
oColumn:Caption := "Job Date"
oColumn:FieldSpec := DateFS{} // your fieldspec
SELF:browser:addColumn(oColumn )
SELF:ViewAs(#BrowseView)
Jamal
Date issue - extremely frustrating!
Thanks very much Jamal, I'll try that right now, and you're right, it does seem to be ignoring the SetDateFormat. That's what's so frustrating!
UPDATE: No, that didn't work either Jamal... Here's the code I used:
local oColumn
SetDateFormat("dd/MM/yyyy")
oColumn := DataColumn{}
oColumn :Width := 15
oColumn :HyperLabel:= HyperLabel{#JOBDATE}
oColumn:Caption := "Job Date"
oColumn:FieldSpec := DateFS{#JOBDATE} // your fieldspec
self:browser:addColumn(oColumn )
UPDATE: No, that didn't work either Jamal... Here's the code I used:
local oColumn
SetDateFormat("dd/MM/yyyy")
oColumn := DataColumn{}
oColumn :Width := 15
oColumn :HyperLabel:= HyperLabel{#JOBDATE}
oColumn:Caption := "Job Date"
oColumn:FieldSpec := DateFS{#JOBDATE} // your fieldspec
self:browser:addColumn(oColumn )
Date issue - extremely frustrating!
Jeff,
Try SetCentury(TRUE). Does that make a difference ?
Robert
Try SetCentury(TRUE). Does that make a difference ?
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
-
- Posts: 774
- Joined: Wed May 17, 2017 8:50 am
- Location: Germany
Date issue - extremely frustrating!
Hi Jeff,
Hard to believe that Roberts SetCentury ( TRUE ) advice doesn´t help ....
SetInternational (#Clipper) sets SetCentury() to false. Therefore, you must add a setcentury (true) after the SetInternational (#Clipper).
SetInternational(#Clipper)
SetCentury(TRUE)
Just tried it with the VO-Databrowser. In a date column the year is correctly shown, either with 2 or 4 digits - without any attached fieldspec.
Seriously asked: Is there more than *one* SetInternational (#Clipper) call in you app ?
regards
Karl-Heinz
Hard to believe that Roberts SetCentury ( TRUE ) advice doesn´t help ....
SetInternational (#Clipper) sets SetCentury() to false. Therefore, you must add a setcentury (true) after the SetInternational (#Clipper).
SetInternational(#Clipper)
SetCentury(TRUE)
Just tried it with the VO-Databrowser. In a date column the year is correctly shown, either with 2 or 4 digits - without any attached fieldspec.
Seriously asked: Is there more than *one* SetInternational (#Clipper) call in you app ?
regards
Karl-Heinz
Date issue - extremely frustrating!
Confirming what Robert and Karl said:
This does not work:
This works:
Jamal
This does not work:
Code: Select all
SetCentury(true) // Does not work here
SetDateFormat("dd/MM/yyyy")
SetInternational(#Clipper)
Code: Select all
SetDateFormat("dd/MM/yyyy")
SetInternational(#Clipper)
SetCentury(true) // MUST be set after SetInternational(#Clipper)
Date issue - extremely frustrating!
Thanks Jamal and Karl-Heinz, but it seems much more sinister things are at work. VO Crashed completely and could't access the repository, So I deleted the whole thing and copied my backup copy of VO onto my PC (not installed, as I've stated before, I have no idea where my VO CD is.)
Whatever I do, I cannot get my app to run at all. I've re-indexed the project, and I get all sorts of varying errors at runtime like my Main Menu is an unknown class etc. On top of that I'm still getting an error in CAVOPP.DLL as I wrote the other day, it crashed exactly at 14 seconds to go every compile. It crashes with the "sorry!" screen, I restart VO and and compile again, it restarts where it left off, and compiles.
Also attached it the current error when trying to start my app. I'm guessing a DLL error, but I have NFI which one...
So now, I'm trying to rebuild the repository, and I get the attached message. Seriously It was never this hard. VO always worked like a dream, now I struggle to get the damn thing to stay stable.
I've asked this before without much success, but does anyone have a full install file that I can wipe my entire PC and start with VO 2.8SP4 fresh? There are just too many things going wrong with my version, and I think every time I copy it back from my old files, I'm probably re-importing the same problems.
Whatever I do, I cannot get my app to run at all. I've re-indexed the project, and I get all sorts of varying errors at runtime like my Main Menu is an unknown class etc. On top of that I'm still getting an error in CAVOPP.DLL as I wrote the other day, it crashed exactly at 14 seconds to go every compile. It crashes with the "sorry!" screen, I restart VO and and compile again, it restarts where it left off, and compiles.
Also attached it the current error when trying to start my app. I'm guessing a DLL error, but I have NFI which one...
So now, I'm trying to rebuild the repository, and I get the attached message. Seriously It was never this hard. VO always worked like a dream, now I struggle to get the damn thing to stay stable.
I've asked this before without much success, but does anyone have a full install file that I can wipe my entire PC and start with VO 2.8SP4 fresh? There are just too many things going wrong with my version, and I think every time I copy it back from my old files, I'm probably re-importing the same problems.
- Attachments
-
- BMDBG.JPG (21.01 KiB) Viewed 722 times
-
- Repo.JPG (18.8 KiB) Viewed 722 times
Date issue - extremely frustrating!
Jeff,
If you mail me your VO 2.8 SP4 serial number, then I will verify that number.
If the number is correct then I'll mail you a download link for a SP4 installer.
Robert at XSharp dot EU
If you mail me your VO 2.8 SP4 serial number, then I will verify that number.
If the number is correct then I'll mail you a download link for a SP4 installer.
Robert at XSharp dot EU
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
Date issue - extremely frustrating!
Brilliant. Thank you so much Robert. Check your messages