Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Bug Reports (Closed)
 (v3.4) BUG+FIX: pop_datepicker.asp
 Forum Locked  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 5

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 20 August 2002 :  01:00:17  Show Profile
quote:
Originally posted by Nathan

It would probably be wise to allow future dates.

That would leave the feature open for other uses, such as, say, an events calendar among other things.

I don't want to allow future dates. I included this for use only with the DOB feature and changed the coding specifically for that. By default it had a feature to disallow dates in the past, I just modified it to only allow dates in the past.
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 20 August 2002 :  01:03:07  Show Profile
quote:
Originally posted by GauravBhabu

quote:
One Minor Problem, however will have no effect on processing


I know Richard, that is what I referred as a Minor Problem. I will work on it, as using >= 0 was having some other implications.


what other implications?
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 20 August 2002 :  01:14:54  Show Profile
Nothing major and most will not even notice or worry about it. But I know the reason and will fix it. Here is link to my test site for 3.4, I have created an account with username snitz/ snitz. you can test the date picker there.
Go to Top of Page

lir
New Member

USA
67 Posts

Posted - 20 August 2002 :  01:47:54  Show Profile
Richard,

Check out my post on this a couple days ago
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=32986#162039

It fixed the date problem and kept your logic in there about switching the month and day if necessary.


lir
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 20 August 2002 :  02:52:52  Show Profile
quote:
Originally posted by RichardKinser
I don't want to allow future dates. I included this for use only with the DOB feature and changed the coding specifically for that. By default it had a feature to disallow dates in the past, I just modified it to only allow dates in the past.



Okay, I have restricted the future dates. Test it Here
User/Pwd: snitz/snitz

CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain

It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.

Prayer Of Forgiveness
"I forgive all living beings. May all living beings forgive me!
I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated)
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 20 August 2002 :  03:24:26  Show Profile
I've already fixed this file by comparing the code you had in your first post and changing it in the original file.

On that test you have, the arrow still shows up to goto September 2002 from August 2002, even though when you click it, you stay on the same page.
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 20 August 2002 :  06:58:09  Show Profile
GauravBhabu,

I uploaded the "fixed" file, but it's not working correctly. The day/month are being switched when editing your birthdate. I used the code that was in your first post, but it doesn't seem to be working correctly. You can try it on this site.
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 20 August 2002 :  07:09:52  Show Profile
I tried but there is no switching. Tried several times.

There is a minor problem, not about switching though, and I have already fixed that as well. I will post a link to text version of the file with all the corrections.
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 20 August 2002 :  07:27:59  Show Profile
ok, it's working now.

I changed this:

if IsDate(Request.QueryString("date")) then
strDOBDate = Request.QueryString("date")
dDate = strDOBDate



to this:

if IsDate(Request.QueryString("date")) then
strDOBDate = Request.QueryString("date")
dDate = Mid(strDOBDate,4,2) & "-" & MonthName(Mid(strDOBDate, 1,2)) & "-" & Mid(strDOBDate, 7,4)

Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 20 August 2002 :  08:08:57  Show Profile
Richard, that will work only when the Month and Day are two digit numbers. Try Year 2002 and Month of August and then click on the arrows to go back and you will get error.

The reason:
When there is birthdate found in the database, it is processed in inc_datepicker.js and then passed on to the pop_datepicker.asp. The format is MM/DD/YYYY.
But in the next month and prev month links days and months are not padded with zeros. So the Mid function finds the '/', which gives an error.

So we need to modify the way the date is passed with the URL so that days and months are padded with zeros.

CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain

It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.

Prayer Of Forgiveness
"I forgive all living beings. May all living beings forgive me!
I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated)
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 20 August 2002 :  21:39:41  Show Profile
Fix for DatePicker to select Birthdate

The changes need to made to the following files:

1. inc_datepicker.js
2. pop_datepicker.asp

File: inc_datepicker.js


Find the following function (Lines 27-39)

function _ShowPopupCalendar( i_strFormName, i_strFieldName, i_blnHistory )
{
var strURL = 'pop_datepicker.asp?FormName=' + i_strFormName + '&FieldName=' + i_strFieldName;
if (i_blnHistory)
strURL = strURL + '&History=on';
else
strURL = strURL + '&History=off';

window.datefield = document.forms[i_strFormName][i_strFieldName];
var strDate = Mid(window.datefield.value,4,2) + '/' + Mid(window.datefield.value,6,2) + '/' + Mid(window.datefield.value,0,4);
window.open( strURL + '&date=' + strDate, 'cal', 'width=295,height=290' );
}


Replace the statment in red as highlighted above with the sattement in blue as shown below


function _ShowPopupCalendar( i_strFormName, i_strFieldName, i_blnHistory )
{ var strURL = 'pop_datepicker.asp?FormName=' + i_strFormName + '&FieldName=' + i_strFieldName;
if (i_blnHistory)
strURL = strURL + '&History=on';
else
strURL = strURL + '&History=off';
window.datefield = document.forms[i_strFormName][i_strFieldName];
var strDate = window.datefield.value;
window.open(strURL + '&date=' + strDate, 'cal', 'width=295,height=290' );
}


File: pop_datepicker.asp

There are many changes made to this file, all you have to do is replace the existing file. Download the pop_datepicker.zip file from the link below. Extract the new modified file from the zip file and upload to your web server.

Download Link

CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain

It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.

Prayer Of Forgiveness
"I forgive all living beings. May all living beings forgive me!
I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated)
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 20 August 2002 :  21:42:25  Show Profile
for even greater compatibility, I'm going to remove the ReplaceUrlArgs function and the CurrenURL() function because the ReplaceUrlArgs uses a vbscript regex which is only supported in vbscript v5.0 and up.
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 20 August 2002 :  21:45:10  Show Profile
Yeah, that can be done. If you upload the new file here or at any of your test sites I would like to test. Thanks.
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 20 August 2002 :  21:56:42  Show Profile
quote:
Originally posted by RichardKinser

for even greater compatibility, I'm going to remove the ReplaceUrlArgs function and the CurrenURL() function because the ReplaceUrlArgs uses a vbscript regex which is only supported in vbscript v5.0 and up.




You can add these statement to the beginning of the following function, in case to keep the function in the file
function ReplaceUrlArgs( i_sURL, i_sArgs  )
ReplaceUrlArgs = "pop_datepicker.asp?" & i_sArgs
exit function



Richard, is it okay, if I remove the code in earlier posts to avoid confusion
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 20 August 2002 :  22:09:41  Show Profile
that's fine with me.
Go to Top of Page
Page: of 5 Previous Topic Topic Next Topic  
Previous Page | Next Page
 Forum Locked  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000 Version 3.4.07