HighDots Forums  

calendar extension date problems

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss calendar extension date problems in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Andrea
 
Posts: n/a

Default calendar extension date problems - 06-28-2004 , 09:47 PM






Hello,

I've just installed the Dreamlettes Calendar extension into DWMX2004 and I'm
having a few problems with date formats. I'm using Asp with an Access
database, and I'm in Australia so the date format is dd/mm/yyyy. The
extension uses the US format (mm/dd/yyyy). Has anyone had/resolved the same
issue - or knowes what I should do to change the code below?
Thanks!!
Andrea.

_____________________

Function ASPCalendar
If Request("EventDate") <> "" Then
EventDate = DateValue(Request("EventDate"))
Else
EventDate = date()
End if
CurMonth = Month(EventDate)
CurMonthName = MonthName(CurMonth)
CurYear = Year(EventDate)
FirstDayDate = DateSerial(CurYear, CurMonth, 1)
FirstDay = WeekDay(FirstDayDate, 0)
CurDay = FirstDayDate
Dim tmpHTML
tmpHTML=""
tmpHTML = tmpHTML & "<table summary=""small_calendar"" id=""calendar""
cellspacing=""0"">" & Chr(10)
tmpHTML = tmpHTML & "<caption>small_calendar</caption>" & Chr(10)
tmpHTML = tmpHTML & "<tr id=""title"">" & Chr(10)
tmpHTML = tmpHTML & "<th colspan=""7"">" & Chr(10)
tmpHTML = tmpHTML & "<a href=""?EventDate=" &
Server.URLEncode(DateAdd("m",-1, EventDate)) & """>&lt;</a>" & CurMonthName
& "<a href=""?EventDate=" & Server.URLEncode(DateAdd("m",1,EventDate)) &
""">&gt;</a>"
tmpHTML = tmpHTML & "<a href=""?EventDate=" &
Server.URLEncode(DateAdd("yyyy",-1, EventDate)) & """>&lt;</a>" & CurYear &
"<a href=""?EventDate=" & Server.URLEncode(DateAdd("yyyy",1,EventDate)) &
""">&gt;</a>"
tmpHTML = tmpHTML & "</th>" & Chr(10) & "</tr>" & Chr(10) & "<tr
id=""days"">"
Response.Write(tmpHTML)
For DayLoop = 1 to 7
Response.Write("<th>" & WeekDayName(Dayloop, True, 0) & "</th>" & Chr(10))
Next
Response.Write("</tr>" & Chr(10) & "<tr class=""firstweek"">")
If FirstDay <> 1 Then
Response.Write("<td colspan=""" & (FirstDay -1) & """
class=""blank"">&nbsp;</td>" & Chr(10))
End if
DayCounter = FirstDay
CorrectMonth = True
Do While CorrectMonth = True
isEvent = FALSE
events_cal.filter = 0
Dim iCheck
Dim chkStr
chkStr = (events_cal.Fields.Item("event_date").Name)
iCheck = CurDay
events_cal.filter = chkStr & "=" & (iCheck)
If not(events_cal.EOF) Then isEvent = TRUE
If CurDay = EventDate Then
Response.Write("<td class=""today"">")
Else
Response.Write("<td class=""day" & DayCounter & """>")
End if
If isEvent = TRUE Then
Response.Write("<a href=""events_list_date2.asp?EventDate=" &
Server.URLEncode(CurDay) & """>" & Day(CurDay)& "</a>")
Response.Write("</td>" & Chr(10))
Else
Response.Write(Day(CurDay) & "</td>" & Chr(10))
End If
DayCounter = DayCounter + 1
If DayCounter > 7 Then
DayCounter = 1
Response.Write("</tr>" & Chr(10))
Response.Write("<tr")
If Month(CurDay+8) <> CurMonth Then
Response.Write(" class=""lastweek""")
End If
Response.Write(">" & Chr(10))
End if
CurDay = DateAdd("d", 1, CurDay)
If Month(CurDay) <> CurMonth then
CorrectMonth = False
End if
Loop
IF DayCounter <> 1 Then
Response.Write("<td colspan=""" & (8-DayCounter) & """
class=""blank"">&nbsp;</td>")
Else
Response.Write("<td colspan=""7"" class=""blank"">&nbsp;</td>")
End if
Response.Write("</tr>" & Chr(10) & "</table>" & Chr(10))
End Function



Reply With Quote
  #2  
Old   
Piers 2k
 
Posts: n/a

Default Re: calendar extension date problems - 06-29-2004 , 03:30 AM






Andrea,

I've come across this with normal dates. Don't know if it will work with
your extension, but it's worth a try.

Need to set the LocaleID to tell your app you are in Australia.

In the top of your file, you need to add one line of code to tell it where
in the world you are. Something like:
SetLocale(3081)

This should make all your dates appear in native format. You could improve
this by putting the localeID setting in your connections file. This means by
default everything that connects to your database picks up the local
setting??

More info and more local settings, try
http://www.w3schools.com/vbscript/func_setlocale.asp

Hope it helps,

Piers

"Andrea" <notvalid (AT) alphalink (DOT) com.au> wrote

Quote:
Hello,

I've just installed the Dreamlettes Calendar extension into DWMX2004 and
I'm
having a few problems with date formats. I'm using Asp with an Access
database, and I'm in Australia so the date format is dd/mm/yyyy. The
extension uses the US format (mm/dd/yyyy). Has anyone had/resolved the
same
issue - or knowes what I should do to change the code below?
Thanks!!
Andrea.

_____________________

Function ASPCalendar
If Request("EventDate") <> "" Then
EventDate = DateValue(Request("EventDate"))
Else
EventDate = date()
End if
CurMonth = Month(EventDate)
CurMonthName = MonthName(CurMonth)
CurYear = Year(EventDate)
FirstDayDate = DateSerial(CurYear, CurMonth, 1)
FirstDay = WeekDay(FirstDayDate, 0)
CurDay = FirstDayDate
Dim tmpHTML
tmpHTML=""
tmpHTML = tmpHTML & "<table summary=""small_calendar"" id=""calendar""
cellspacing=""0"">" & Chr(10)
tmpHTML = tmpHTML & "<caption>small_calendar</caption>" & Chr(10)
tmpHTML = tmpHTML & "<tr id=""title"">" & Chr(10)
tmpHTML = tmpHTML & "<th colspan=""7"">" & Chr(10)
tmpHTML = tmpHTML & "<a href=""?EventDate=" &
Server.URLEncode(DateAdd("m",-1, EventDate)) & """>&lt;</a>" &
CurMonthName
& "<a href=""?EventDate=" & Server.URLEncode(DateAdd("m",1,EventDate)) &
""">></a>"
tmpHTML = tmpHTML & "<a href=""?EventDate=" &
Server.URLEncode(DateAdd("yyyy",-1, EventDate)) & """>&lt;</a>" & CurYear
&
"<a href=""?EventDate=" & Server.URLEncode(DateAdd("yyyy",1,EventDate)) &
""">></a>"
tmpHTML = tmpHTML & "</th>" & Chr(10) & "</tr>" & Chr(10) & "<tr
id=""days"">"
Response.Write(tmpHTML)
For DayLoop = 1 to 7
Response.Write("<th>" & WeekDayName(Dayloop, True, 0) & "</th>" & Chr(10))
Next
Response.Write("</tr>" & Chr(10) & "<tr class=""firstweek"">")
If FirstDay <> 1 Then
Response.Write("<td colspan=""" & (FirstDay -1) & """
class=""blank"">&nbsp;</td>" & Chr(10))
End if
DayCounter = FirstDay
CorrectMonth = True
Do While CorrectMonth = True
isEvent = FALSE
events_cal.filter = 0
Dim iCheck
Dim chkStr
chkStr = (events_cal.Fields.Item("event_date").Name)
iCheck = CurDay
events_cal.filter = chkStr & "=" & (iCheck)
If not(events_cal.EOF) Then isEvent = TRUE
If CurDay = EventDate Then
Response.Write("<td class=""today"">")
Else
Response.Write("<td class=""day" & DayCounter & """>")
End if
If isEvent = TRUE Then
Response.Write("<a href=""events_list_date2.asp?EventDate=" &
Server.URLEncode(CurDay) & """>" & Day(CurDay)& "</a>")
Response.Write("</td>" & Chr(10))
Else
Response.Write(Day(CurDay) & "</td>" & Chr(10))
End If
DayCounter = DayCounter + 1
If DayCounter > 7 Then
DayCounter = 1
Response.Write("</tr>" & Chr(10))
Response.Write("<tr")
If Month(CurDay+8) <> CurMonth Then
Response.Write(" class=""lastweek""")
End If
Response.Write(">" & Chr(10))
End if
CurDay = DateAdd("d", 1, CurDay)
If Month(CurDay) <> CurMonth then
CorrectMonth = False
End if
Loop
IF DayCounter <> 1 Then
Response.Write("<td colspan=""" & (8-DayCounter) & """
class=""blank"">&nbsp;</td>")
Else
Response.Write("<td colspan=""7"" class=""blank"">&nbsp;</td>")
End if
Response.Write("</tr>" & Chr(10) & "</table>" & Chr(10))
End Function





Reply With Quote
  #3  
Old   
Andrea
 
Posts: n/a

Default Re: calendar extension date problems - 06-29-2004 , 07:48 AM



Thanks Piers!
I've tried to set a session using the LCID ID for here, and I tried your
suggestion for the locale ID. Alas, neither seems to work. I'm at a bit of
a loss as to what to do - all the links return like this
?EventDate=mm/dd/yyyy . Its only with this calendar extension, the rest of
my site is fine with dates in the normal format. I think it must be the
code, and I don't understand enough to work it out.




"Piers 2k" <piers.subscribe (AT) ntlworld (DOT) com> wrote

Quote:
Andrea,

I've come across this with normal dates. Don't know if it will work with
your extension, but it's worth a try.

Need to set the LocaleID to tell your app you are in Australia.

In the top of your file, you need to add one line of code to tell it where
in the world you are. Something like:
SetLocale(3081)

This should make all your dates appear in native format. You could improve
this by putting the localeID setting in your connections file. This means
by
default everything that connects to your database picks up the local
setting??

More info and more local settings, try
http://www.w3schools.com/vbscript/func_setlocale.asp

Hope it helps,

Piers

"Andrea" <notvalid (AT) alphalink (DOT) com.au> wrote in message
news:40e0ca25 (AT) news (DOT) alphalink.com.au...
| Hello,
|
| I've just installed the Dreamlettes Calendar extension into DWMX2004 and
I'm
| having a few problems with date formats. I'm using Asp with an Access
| database, and I'm in Australia so the date format is dd/mm/yyyy. The
| extension uses the US format (mm/dd/yyyy). Has anyone had/resolved the
same
| issue - or knowes what I should do to change the code below?
| Thanks!!
| Andrea.
|
| _____________________
|
| Function ASPCalendar
| If Request("EventDate") <> "" Then
| EventDate = DateValue(Request("EventDate"))
| Else
| EventDate = date()
| End if
| CurMonth = Month(EventDate)
| CurMonthName = MonthName(CurMonth)
| CurYear = Year(EventDate)
| FirstDayDate = DateSerial(CurYear, CurMonth, 1)
| FirstDay = WeekDay(FirstDayDate, 0)
| CurDay = FirstDayDate
| Dim tmpHTML
| tmpHTML=""
| tmpHTML = tmpHTML & "<table summary=""small_calendar"" id=""calendar""
| cellspacing=""0"">" & Chr(10)
| tmpHTML = tmpHTML & "<caption>small_calendar</caption>" & Chr(10)
| tmpHTML = tmpHTML & "<tr id=""title"">" & Chr(10)
| tmpHTML = tmpHTML & "<th colspan=""7"">" & Chr(10)
| tmpHTML = tmpHTML & "<a href=""?EventDate=" &
| Server.URLEncode(DateAdd("m",-1, EventDate)) & """>&lt;</a>" &
CurMonthName
| & "<a href=""?EventDate=" & Server.URLEncode(DateAdd("m",1,EventDate)) &
| """>></a>"
| tmpHTML = tmpHTML & "<a href=""?EventDate=" &
| Server.URLEncode(DateAdd("yyyy",-1, EventDate)) & """>&lt;</a>" &
CurYear
&
| "<a href=""?EventDate=" & Server.URLEncode(DateAdd("yyyy",1,EventDate))
&
| """>></a>"
| tmpHTML = tmpHTML & "</th>" & Chr(10) & "</tr>" & Chr(10) & "<tr
| id=""days"">"
| Response.Write(tmpHTML)
| For DayLoop = 1 to 7
| Response.Write("<th>" & WeekDayName(Dayloop, True, 0) & "</th>" &
Chr(10))
| Next
| Response.Write("</tr>" & Chr(10) & "<tr class=""firstweek"">")
| If FirstDay <> 1 Then
| Response.Write("<td colspan=""" & (FirstDay -1) & """
| class=""blank"">&nbsp;</td>" & Chr(10))
| End if
| DayCounter = FirstDay
| CorrectMonth = True
| Do While CorrectMonth = True
| isEvent = FALSE
| events_cal.filter = 0
| Dim iCheck
| Dim chkStr
| chkStr = (events_cal.Fields.Item("event_date").Name)
| iCheck = CurDay
| events_cal.filter = chkStr & "=" & (iCheck)
| If not(events_cal.EOF) Then isEvent = TRUE
| If CurDay = EventDate Then
| Response.Write("<td class=""today"">")
| Else
| Response.Write("<td class=""day" & DayCounter & """>")
| End if
| If isEvent = TRUE Then
| Response.Write("<a href=""events_list_date2.asp?EventDate=" &
| Server.URLEncode(CurDay) & """>" & Day(CurDay)& "</a>")
| Response.Write("</td>" & Chr(10))
| Else
| Response.Write(Day(CurDay) & "</td>" & Chr(10))
| End If
| DayCounter = DayCounter + 1
| If DayCounter > 7 Then
| DayCounter = 1
| Response.Write("</tr>" & Chr(10))
| Response.Write("<tr")
| If Month(CurDay+8) <> CurMonth Then
| Response.Write(" class=""lastweek""")
| End If
| Response.Write(">" & Chr(10))
| End if
| CurDay = DateAdd("d", 1, CurDay)
| If Month(CurDay) <> CurMonth then
| CorrectMonth = False
| End if
| Loop
| IF DayCounter <> 1 Then
| Response.Write("<td colspan=""" & (8-DayCounter) & """
| class=""blank"">&nbsp;</td>")
| Else
| Response.Write("<td colspan=""7"" class=""blank"">&nbsp;</td>")
| End if
| Response.Write("</tr>" & Chr(10) & "</table>" & Chr(10))
| End Function
|
|





Reply With Quote
  #4  
Old   
Piers 2k
 
Posts: n/a

Default Re: calendar extension date problems - 06-29-2004 , 08:05 AM



I'm afraid that's where I stop as well. I think you need someone who's got
the extension...

Soz, Piers

"Andrea" <asimpson (AT) alphalink (DOT) com.au> wrote

Quote:
Thanks Piers!
I've tried to set a session using the LCID ID for here, and I tried your
suggestion for the locale ID. Alas, neither seems to work. I'm at a bit
of
a loss as to what to do - all the links return like this
?EventDate=mm/dd/yyyy . Its only with this calendar extension, the rest of
my site is fine with dates in the normal format. I think it must be the
code, and I don't understand enough to work it out.




"Piers 2k" <piers.subscribe (AT) ntlworld (DOT) com> wrote in message
news:cbr629$d6u$1 (AT) forums (DOT) macromedia.com...
Andrea,

I've come across this with normal dates. Don't know if it will work with
your extension, but it's worth a try.

Need to set the LocaleID to tell your app you are in Australia.

In the top of your file, you need to add one line of code to tell it
where
in the world you are. Something like:
SetLocale(3081)

This should make all your dates appear in native format. You could
improve
this by putting the localeID setting in your connections file. This
means
by
default everything that connects to your database picks up the local
setting??

More info and more local settings, try
http://www.w3schools.com/vbscript/func_setlocale.asp

Hope it helps,

Piers

"Andrea" <notvalid (AT) alphalink (DOT) com.au> wrote in message
news:40e0ca25 (AT) news (DOT) alphalink.com.au...
| Hello,
|
| I've just installed the Dreamlettes Calendar extension into DWMX2004
and
I'm
| having a few problems with date formats. I'm using Asp with an Access
| database, and I'm in Australia so the date format is dd/mm/yyyy. The
| extension uses the US format (mm/dd/yyyy). Has anyone had/resolved
the
same
| issue - or knowes what I should do to change the code below?
| Thanks!!
| Andrea.
|
| _____________________
|
| Function ASPCalendar
| If Request("EventDate") <> "" Then
| EventDate = DateValue(Request("EventDate"))
| Else
| EventDate = date()
| End if
| CurMonth = Month(EventDate)
| CurMonthName = MonthName(CurMonth)
| CurYear = Year(EventDate)
| FirstDayDate = DateSerial(CurYear, CurMonth, 1)
| FirstDay = WeekDay(FirstDayDate, 0)
| CurDay = FirstDayDate
| Dim tmpHTML
| tmpHTML=""
| tmpHTML = tmpHTML & "<table summary=""small_calendar"" id=""calendar""
| cellspacing=""0"">" & Chr(10)
| tmpHTML = tmpHTML & "<caption>small_calendar</caption>" & Chr(10)
| tmpHTML = tmpHTML & "<tr id=""title"">" & Chr(10)
| tmpHTML = tmpHTML & "<th colspan=""7"">" & Chr(10)
| tmpHTML = tmpHTML & "<a href=""?EventDate=" &
| Server.URLEncode(DateAdd("m",-1, EventDate)) & """>&lt;</a>" &
CurMonthName
| & "<a href=""?EventDate=" & Server.URLEncode(DateAdd("m",1,EventDate))
&
| """>></a>"
| tmpHTML = tmpHTML & "<a href=""?EventDate=" &
| Server.URLEncode(DateAdd("yyyy",-1, EventDate)) & """>&lt;</a>" &
CurYear
&
| "<a href=""?EventDate=" &
Server.URLEncode(DateAdd("yyyy",1,EventDate))
&
| """>></a>"
| tmpHTML = tmpHTML & "</th>" & Chr(10) & "</tr>" & Chr(10) & "<tr
| id=""days"">"
| Response.Write(tmpHTML)
| For DayLoop = 1 to 7
| Response.Write("<th>" & WeekDayName(Dayloop, True, 0) & "</th>" &
Chr(10))
| Next
| Response.Write("</tr>" & Chr(10) & "<tr class=""firstweek"">")
| If FirstDay <> 1 Then
| Response.Write("<td colspan=""" & (FirstDay -1) & """
| class=""blank"">&nbsp;</td>" & Chr(10))
| End if
| DayCounter = FirstDay
| CorrectMonth = True
| Do While CorrectMonth = True
| isEvent = FALSE
| events_cal.filter = 0
| Dim iCheck
| Dim chkStr
| chkStr = (events_cal.Fields.Item("event_date").Name)
| iCheck = CurDay
| events_cal.filter = chkStr & "=" & (iCheck)
| If not(events_cal.EOF) Then isEvent = TRUE
| If CurDay = EventDate Then
| Response.Write("<td class=""today"">")
| Else
| Response.Write("<td class=""day" & DayCounter & """>")
| End if
| If isEvent = TRUE Then
| Response.Write("<a href=""events_list_date2.asp?EventDate=" &
| Server.URLEncode(CurDay) & """>" & Day(CurDay)& "</a>")
| Response.Write("</td>" & Chr(10))
| Else
| Response.Write(Day(CurDay) & "</td>" & Chr(10))
| End If
| DayCounter = DayCounter + 1
| If DayCounter > 7 Then
| DayCounter = 1
| Response.Write("</tr>" & Chr(10))
| Response.Write("<tr")
| If Month(CurDay+8) <> CurMonth Then
| Response.Write(" class=""lastweek""")
| End If
| Response.Write(">" & Chr(10))
| End if
| CurDay = DateAdd("d", 1, CurDay)
| If Month(CurDay) <> CurMonth then
| CorrectMonth = False
| End if
| Loop
| IF DayCounter <> 1 Then
| Response.Write("<td colspan=""" & (8-DayCounter) & """
| class=""blank"">&nbsp;</td>")
| Else
| Response.Write("<td colspan=""7"" class=""blank"">&nbsp;</td>")
| End if
| Response.Write("</tr>" & Chr(10) & "</table>" & Chr(10))
| End Function
|
|







Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.