Author |
Topic |
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 20 August 2002 : 01:00:17
|
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. |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 20 August 2002 : 01:03:07
|
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? |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 20 August 2002 : 01:14:54
|
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. |
|
|
lir
New Member
USA
67 Posts |
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 20 August 2002 : 02:52:52
|
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) |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 20 August 2002 : 03:24:26
|
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. |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 20 August 2002 : 06:58:09
|
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. |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 20 August 2002 : 07:09:52
|
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. |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 20 August 2002 : 07:27:59
|
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)
|
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 20 August 2002 : 08:08:57
|
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) |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 20 August 2002 : 21:39:41
|
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) |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 20 August 2002 : 21:42:25
|
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. |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 20 August 2002 : 21:45:10
|
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. |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 20 August 2002 : 21:56:42
|
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 |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 20 August 2002 : 22:09:41
|
that's fine with me. |
|
|
Topic |
|