I took the Timezone changes one step further
Moderator: davidyin
I took the Timezone changes one step further
First off, David, I appreciate the timezone change that you made. The people in the locations in the other timezones finally quit complaining
Your changes were great, but not exactly what I wanted. I took the little knowledge that I have gained from this In/Out Board in ASP/VBScript and made a few of my own changes.
I was looking to have the times that were displayed altered according to the users timezone no matter where they were. Currently the time is only changed when you are looking in a location that is different than the server.
An example is this:
Server time is: 3pm CST
Server is in -7 CST
Location1 is in -7 CST
Location2 is in -6 MST
User1 is in location1 (-7) CST
User2 is in location2 (-6) MST
User 1 is set to lunch and returning at 4pm CST
User2 looks in Location1 to see when User1 will get back from lunch. I want User2 to see that User1 will get back at 3pm MST. (It is setup right now so User2 would see that User1 is getting back at 4 CST because Location1 is in CST, this means User2 would have to still remember that Location1 is 1 hour ahead of them).
Anyway, the changes I made did what I wanted them to. If you don't understand what I wanted you could have two Pentacle installs. One as David's Original and another with my changes. Create two locations in different time zones and two users. One user in one timezone the other user in the other timezone. Set up different scenarios and compare how mine displays it differently, then you should understand (if my explination didn't work)
I also made the fields read only when setting the return time because I didn't want the users to enter their own time in which wouldn't be compatible with the server format and have the wrong times displayed. This way they are forced to click on the calendar icon to select their time.
There is a file called Comparison.html that is included with the .zip file it is a side by side comparison between David's Original files (on the left) and my files that were updated (on the right) . Be sure to read the README.txt file as well, it explains that a column MUST be added to a table in the database or the page will not display correctly.
I by no means am a ASP programmer, so if my code is bad/dirty please feel free to make any changes you see fit.
I will let you look into these changes and then we can discuss them further. I look forward to your input.
Tyler
Your changes were great, but not exactly what I wanted. I took the little knowledge that I have gained from this In/Out Board in ASP/VBScript and made a few of my own changes.
I was looking to have the times that were displayed altered according to the users timezone no matter where they were. Currently the time is only changed when you are looking in a location that is different than the server.
An example is this:
Server time is: 3pm CST
Server is in -7 CST
Location1 is in -7 CST
Location2 is in -6 MST
User1 is in location1 (-7) CST
User2 is in location2 (-6) MST
User 1 is set to lunch and returning at 4pm CST
User2 looks in Location1 to see when User1 will get back from lunch. I want User2 to see that User1 will get back at 3pm MST. (It is setup right now so User2 would see that User1 is getting back at 4 CST because Location1 is in CST, this means User2 would have to still remember that Location1 is 1 hour ahead of them).
Anyway, the changes I made did what I wanted them to. If you don't understand what I wanted you could have two Pentacle installs. One as David's Original and another with my changes. Create two locations in different time zones and two users. One user in one timezone the other user in the other timezone. Set up different scenarios and compare how mine displays it differently, then you should understand (if my explination didn't work)
I also made the fields read only when setting the return time because I didn't want the users to enter their own time in which wouldn't be compatible with the server format and have the wrong times displayed. This way they are forced to click on the calendar icon to select their time.
There is a file called Comparison.html that is included with the .zip file it is a side by side comparison between David's Original files (on the left) and my files that were updated (on the right) . Be sure to read the README.txt file as well, it explains that a column MUST be added to a table in the database or the page will not display correctly.
I by no means am a ASP programmer, so if my code is bad/dirty please feel free to make any changes you see fit.
I will let you look into these changes and then we can discuss them further. I look forward to your input.
Tyler
- Attachments
-
- 6.03.0081_tymanv2.zip
- (97.03 KiB) Downloaded 1142 times
Last edited by tyman00 on Tue Mar 07, 2006 12:50 pm, edited 1 time in total.
I found a bug in the code I attached.
In default.asp line 577 needs to change from
to
It was displaying the AM/PM incorrectly.
In default.asp line 577 needs to change from
Code: Select all
ret12hour = Ucase(right(Time,2))
Code: Select all
ret12hour = Ucase(right(userreturn,2))
I feel a little bit confusing about the time zone abobe.
Server time is: 3pm CST
Server is in -7 CST
Location1 is in -7 CST
Location2 is in -6 MST
User1 is in location1 (-7) CST
User2 is in location2 (-6) MST
Let me try to understand it.
CST stands Center Standard Time, it is UTC-6
MST stands Mountain Standard Time, it is UTC-7
So if it is 3pm CST, the MST time is 2pm.
Server timezone is same as location 1 CST, Location 2 is MST.
When server time is 3pm CST, the location 1 is 3pm CST, and location 2 is 2pm MST.
User 1 is in location 1, 3pm CST.
User 2 is in location 2, 2pm MST.
User 1 is set to lunch and returning at 4pm CST.
4pm CST is 3pm CST.
What you want is in the signin/out page, the expected return time entered can be viewed in the first page in which the time format adjusted according to the timezone of the viewer.
Server time is: 3pm CST
Server is in -7 CST
Location1 is in -7 CST
Location2 is in -6 MST
User1 is in location1 (-7) CST
User2 is in location2 (-6) MST
Let me try to understand it.
CST stands Center Standard Time, it is UTC-6
MST stands Mountain Standard Time, it is UTC-7
So if it is 3pm CST, the MST time is 2pm.
Server timezone is same as location 1 CST, Location 2 is MST.
When server time is 3pm CST, the location 1 is 3pm CST, and location 2 is 2pm MST.
User 1 is in location 1, 3pm CST.
User 2 is in location 2, 2pm MST.
User 1 is set to lunch and returning at 4pm CST.
4pm CST is 3pm CST.
What you want is in the signin/out page, the expected return time entered can be viewed in the first page in which the time format adjusted according to the timezone of the viewer.
There are some error in your code.
For example:
When sign in/out, without the expect return time, the error comes.
I have to say, add one more field to divided the time and comment is good idea.
The reason why I put them together in my original design is to save a field to keep the database slim and for simplify the code.
You know, in the begining, this software is working for one location only.
I would like to add this feature into next version.
For example:
When sign in/out, without the expect return time, the error comes.
I have to say, add one more field to divided the time and comment is good idea.
The reason why I put them together in my original design is to save a field to keep the database slim and for simplify the code.
You know, in the begining, this software is working for one location only.
I would like to add this feature into next version.
Yes, this is exactly correct. This is what I would like.davidyin wrote:I feel a little bit confusing about the time zone abobe.
Server time is: 3pm CST
Server is in -7 CST
Location1 is in -7 CST
Location2 is in -6 MST
User1 is in location1 (-7) CST
User2 is in location2 (-6) MST
Let me try to understand it.
CST stands Center Standard Time, it is UTC-6
MST stands Mountain Standard Time, it is UTC-7
So if it is 3pm CST, the MST time is 2pm.
Server timezone is same as location 1 CST, Location 2 is MST.
When server time is 3pm CST, the location 1 is 3pm CST, and location 2 is 2pm MST.
User 1 is in location 1, 3pm CST.
User 2 is in location 2, 2pm MST.
User 1 is set to lunch and returning at 4pm CST.
4pm CST is 3pm CST.
What you want is in the signin/out page, the expected return time entered can be viewed in the first page in which the time format adjusted according to the timezone of the viewer.
I know that without the column there is an error. If you open the README.txt file that I included section B is as follows:davidyin wrote: There are some error in your code.
For example:
When sign in/out, without the expect return time, the error comes.
I have to say, add one more field to divided the time and comment is good idea.
The reason why I put them together in my original design is to save a field to keep the database slim and for simplify the code.
You know, in the begining, this software is working for one location only.
I would like to add this feature into next version.
So yes you are right, you have to add that column. Maybe we can create a batch file that will create that column automatically for those who do not have Microsoft Access. I was thinking something like the upgrade files you made for upgrading from 5.12 to 6.03.README.txt wrote:B. You must modify your database, so Microsoft Access is necessary (or another editor capable of editing
this database). If you do not have one, maybe David will create another patch for us like he did when
upgrading from 5.12 or 6.03.0080 to 6.03.0081. I may look into creating a patch if necessary. I would
much rather David did so, this way your copy is always the same as his. (This sill make your upgrades
much easier in the future for you)
In the database open pt_records. There create a column named: recordreturn
Something else we could consider is adding code to the pages to check to see if that column exists. If it doesn't then it could combine the date/time and comment fields like before.
I can understand why you would want to combine the fields to keep the size of the database down, it is crucial for a smooth and fast running application.
Since I do not have much ASPVBScript knowledge adding the extra "recordreturn" column was the best solution that I could think of. Is there another way to do it that I am missing?
I mean even if the field "recordreturn" added already, the error is still there.
Because the code you added does not check the field value provided or not, the record add precedure will be send the error when the value of recordreturn is null.
Because the code you added does not check the field value provided or not, the record add precedure will be send the error when the value of recordreturn is null.
Last edited by davidyin on Tue Mar 07, 2006 7:19 pm, edited 1 time in total.
Where does the error show up? Is it in the server side error log and not displayed on the page? Do you have a link so I can see it?
I never noticed it.
Edit:
I looked further I am not sure where the error is and where it is comming from. I do check to see if there is data or not in signinout.asp much like the "usercomment" field
In default.asp I do the same here
I never noticed it.
Edit:
I looked further I am not sure where the error is and where it is comming from. I do check to see if there is data or not in signinout.asp much like the "usercomment" field
Code: Select all
if request.form("fldDate") <> empty then
expectreturn = request.form("fldDate")
else
expectreturn = ""
end if
if request.form("usercomment") <> empty then
usercomment = request.form("usercomment")
else
usercomment = ""
Code: Select all
if userreturn <> empty then
....
else
userreturn = ""
end if