CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 [Resolved] Convert database date into german shortdate

Print topic Send  topic

Author Message
Jack_Walter

Posts: 39
Posted: 09/12/2008, 2:33 PM

Hi,

it's me again (unfortunately) O:)

I used the calendar builder and converted the {EventDescription} label into a link. I'm exporting two url strings from this page to the destination page:

Href Source... Parameters (first):
Source Type: DataSource Column
Parameter Source: tour_name
Parameter Name: tour_name

Href Source... Parameters (second):
Source Type: DataSource Column
Parameter Source: tour_departure_date
Parameter Name: tour_departure_date

The destination url looks like this: http://localhost/cruise_db/export_manifest.php?tour_nam...date=2008-09-13

The problem is, that this date [(yyyy-mm-dd) which is stored in the mysql db] has to be converted to dd.mm.yyyy when I click the {EventDescription} link in the calendar page...

It should look like this:
http://localhost/cruise_db/export_manifest.php?tour_nam...date=13.09.2008


[Short edit (just to provide as much information as possible)]:
This line is added to the export_manifest_calendar.php file when I add the second href source parameter (tour_departure_date):

$this->EventDescription->Parameters = CCAddParam($this->EventDescription->Parameters, "tour_departure_date", $this->DataSource->f("tour_departure_date"));

Any help appreciated :-)

Regards,
Jack
View profile  Send private message
wkempees


Posts: 1679
Posted: 09/13/2008, 6:46 AM

  
Href Source... Parameters (second):  
Source Type: Expresion  
Parameter Source: CCFormatDate(CCParseDate($this->DataSource->f('tour_departure_date'),array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn",":","s")), array("dd",".","mm",".","yyyy"))  
Parameter Name: tour_departure_date  

  
$this->EventDescription->Parameters = CCAddParam($this->EventDescription->Parameters, "tour_departure_date", CCFormatDate(CCParseDate($this->DataSource->f('tour_departure_date'),array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn",":","s")), array("dd",".","mm",".","yyyy")));  

Note this is written for a standard MySQL default date, check your settings.

Why did you not just link on the event_id?

Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
Jack_Walter

Posts: 39
Posted: 09/13/2008, 7:27 AM

Quote :
Note this is written for a standard MySQL default date, check your settings.

This date field only uses the yyyy-mm-dd version (no time) so shortening your parameter source to:

CCFormatDate(CCParseDate($this->DataSource->f('tour_departure_date'),array("yyyy", "-", "mm", "-", "dd")), array("dd",".","mm",".","yyyy"))


did it.

Quote :
Why did you not just link on the event_id?

Mh, good question. It was (for me) more obvious to use something that was already visible for the user :*) As long as those things are working afterwards... I'm happy :-D

Thank's a lot for your help Walter! Always appreciated!

If you're bored and have too much time (ok, I don't think that's the case 8-) ) do you probably want to solve this little issue here?: http://forums.codecharge.com/posts.php?post_id=100362

Regards,
Jack
View profile  Send private message
wkempees


Posts: 1679
Posted: 09/13/2008, 7:40 AM

8-)
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.