Re: formatting a date in cfgrid
Just figured this problem out last night. I lost your original email, but from your screen shot it looks the same. It's not in the docs but put a type=date on the cfgridcolumn On 11/4/05, Alexander Hinkley [EMAIL PROTECTED] wrote: i did the update this morning.. i still get the same results.. http://single-dads.us/grid.jpg the petid field shows the format of the date as it comes from the db... via remoting.. On 10/28/05, Mike Nimer [EMAIL PROTECTED] wrote: Upgrade to 7.0.1, we fixed some bugs in cfgrid in the updater. I think this was fixed as well. ---nimer ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:223691 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: formatting a date in cfgrid
i did the update this morning.. i still get the same results.. http://single-dads.us/grid.jpg the petid field shows the format of the date as it comes from the db... via remoting.. On 10/28/05, Mike Nimer [EMAIL PROTECTED] wrote: Upgrade to 7.0.1, we fixed some bugs in cfgrid in the updater. I think this was fixed as well. ---nimer ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:223259 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: formatting a date in cfgrid
You are using Flash Remoting, not the query attribute of CFGRID? If you are doing that you can't use the cfgrid date format logic, it won't be applied automatically. You'll have to format the string in your sql. And send it over that way. --nimer -Original Message- From: Alexander Hinkley [mailto:[EMAIL PROTECTED] Sent: Friday, November 04, 2005 2:48 PM To: CF-Talk Subject: Re: formatting a date in cfgrid i did the update this morning.. i still get the same results.. http://single-dads.us/grid.jpg the petid field shows the format of the date as it comes from the db... via remoting.. On 10/28/05, Mike Nimer [EMAIL PROTECTED] wrote: Upgrade to 7.0.1, we fixed some bugs in cfgrid in the updater. I think this was fixed as well. ---nimer ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:223260 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: formatting a date in cfgrid
Mike, there's a format object you can use if you are building your dataprovider from the query as in this example: -- var fmt : DateFormat = DateFormat.getDateInstance(DateFormat.SHORT); for(i = 0; i refRs.getLength(); i++) { // format the date objects dt = new Date(refRs.getItemAt(i).reqDt); rec = fmt.format(dt); dt = new Date(refRs.getItemAt(i).dtAssigned); cont = fmt.format(dt); tmp = { REQDT: rec, DTASSIGNED: cont, NAME: refRs.getItemAt(i).name, }; refData.push(tmp); } - -Original Message- From: Mike Nimer [mailto:[EMAIL PROTECTED] Sent: Friday, November 04, 2005 2:02 PM To: CF-Talk Subject: RE: formatting a date in cfgrid You are using Flash Remoting, not the query attribute of CFGRID? If you are doing that you can't use the cfgrid date format logic, it won't be applied automatically. You'll have to format the string in your sql. And send it over that way. --nimer ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:223263 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: formatting a date in cfgrid
Upgrade to 7.0.1, we fixed some bugs in cfgrid in the updater. I think this was fixed as well. ---nimer -Original Message- From: Jean-Baptiste Emanuel Zorg [mailto:[EMAIL PROTECTED] Sent: Monday, October 24, 2005 8:48 AM To: CF-Talk Subject: Re: formatting a date in cfgrid thanks for the examples.. by backend.. i meant the sql.. i consider front end my display.. as for the code.. i am populating a grid via flash remoting. cfgridcolumn name=feedDate header=Feed Date mask=, MMM. D, at H:NN A/ that is all there is... On 10/24/05, Bobby Hartsfield [EMAIL PROTECTED] wrote: Well it is still front end really. Alan doesn't mean insert the date into the database already formatted in any special way; He means SELECT it in the desired format so you don't need to format it anywhere else. In MySql for example... SELECT DATE_FORMAT(DateField, '%W, %M %D, %Y'); Would give you the date formatted like this straight from your query and all you'd need to do was output it... 'Sunday, October 24th, 2005' You could use datepart() or convert() to get 'basically' the same thing from SQL Server (I'm not sure SQL server has anything for Nth day though) Believe it or not, even MS Access comes equipped with some date functions :^O That's probably enough to fix you up but if you have any trouble just let us know the date/time format you are looking for and what database you are using. Ps... In CF, the mask is the last option in the function like... Dateformat(mydate, mm dd ) And not the first like... Dateformat(mm dd , mydate) When I started writing .NET apps I was very used to CF's XFormat() functions where the mask was always last. The mask comes first in VB's date formatter and when I put it last, the mask was actually displayed like you're descriing. I THINK CF would throw an error if it were backwards but it's worth checking. Just seems very odd that it displays the mask. You might also consider posting the bit of code that is displaying the mask so everyone can take a look. ..:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Jean-Baptiste Emanuel Zorg [mailto:[EMAIL PROTECTED] Sent: Sunday, October 23, 2005 11:32 PM To: CF-Talk Subject: Re: formatting a date in cfgrid it's just a regular date/time field always figured i could do it on the front end somehow.. i'll give that a lookig into though.. thanks On 10/23/05, Alan Rother [EMAIL PROTECTED] wrote: This is just totally off the cuff here... But if you can't get CF to do it right off, you could have your DB do it. Just apply a date mask to it in the query. Most DB systems allow you to do this. HTH Alan Rother Macromedia Certified Advanced ColdFusion MX 7 Developer On 10/23/05, Jean-Baptiste Emanuel Zorg [EMAIL PROTECTED] wrote: i have a date that is populating a field in a grid like this: Tue Oct 18 21:25:48 GMT-0400 2005 i have attempted to use mask= D, but all it does is output the mask to the field.. any ideas how to mask this? thanks ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:222567 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: formatting a date in cfgrid
Upgrade to 7.0.1, we fixed some bugs in cfgrid in the updater. I think this was fixed as well. ---nimer ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:222569 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: formatting a date in cfgrid
Well it is still front end really. Alan doesnt mean insert the date into the database already formatted in any special way; He means SELECT it in the desired format so you don't need to format it anywhere else. In MySql for example... SELECT DATE_FORMAT(DateField, '%W, %M %D, %Y'); Would give you the date formatted like this straight from your query and all you'd need to do was output it... 'Sunday, October 24th, 2005' You could use datepart() or convert() to get 'basically' the same thing from SQL Server (I'm not sure SQL server has anything for Nth day though) Believe it or not, even MS Access comes equipped with some date functions :^O That's probably enough to fix you up but if you have any trouble just let us know the date/time format you are looking for and what database you are using. Ps... In CF, the mask is the last option in the function like... Dateformat(mydate, mm dd ) And not the first like... Dateformat(mm dd , mydate) When I started writing .NET apps I was very used to CF's XFormat() functions where the mask was always last. The mask comes first in VB's date formatter and when I put it last, the mask was actually displayed like you're descriing. I THINK CF would throw an error if it were backwards but it's worth checking. Just seems very odd that it displays the mask. You might also consider posting the bit of code that is displaying the mask so everyone can take a look. ..:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Jean-Baptiste Emanuel Zorg [mailto:[EMAIL PROTECTED] Sent: Sunday, October 23, 2005 11:32 PM To: CF-Talk Subject: Re: formatting a date in cfgrid it's just a regular date/time field always figured i could do it on the front end somehow.. i'll give that a lookig into though.. thanks On 10/23/05, Alan Rother [EMAIL PROTECTED] wrote: This is just totally off the cuff here... But if you can't get CF to do it right off, you could have your DB do it. Just apply a date mask to it in the query. Most DB systems allow you to do this. HTH Alan Rother Macromedia Certified Advanced ColdFusion MX 7 Developer On 10/23/05, Jean-Baptiste Emanuel Zorg [EMAIL PROTECTED] wrote: i have a date that is populating a field in a grid like this: Tue Oct 18 21:25:48 GMT-0400 2005 i have attempted to use mask= D, but all it does is output the mask to the field.. any ideas how to mask this? thanks ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:222009 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: formatting a date in cfgrid
thanks for the examples.. by backend.. i meant the sql.. i consider front end my display.. as for the code.. i am populating a grid via flash remoting. cfgridcolumn name=feedDate header=Feed Date mask=, MMM. D, at H:NN A/ that is all there is... On 10/24/05, Bobby Hartsfield [EMAIL PROTECTED] wrote: Well it is still front end really. Alan doesn't mean insert the date into the database already formatted in any special way; He means SELECT it in the desired format so you don't need to format it anywhere else. In MySql for example... SELECT DATE_FORMAT(DateField, '%W, %M %D, %Y'); Would give you the date formatted like this straight from your query and all you'd need to do was output it... 'Sunday, October 24th, 2005' You could use datepart() or convert() to get 'basically' the same thing from SQL Server (I'm not sure SQL server has anything for Nth day though) Believe it or not, even MS Access comes equipped with some date functions :^O That's probably enough to fix you up but if you have any trouble just let us know the date/time format you are looking for and what database you are using. Ps... In CF, the mask is the last option in the function like... Dateformat(mydate, mm dd ) And not the first like... Dateformat(mm dd , mydate) When I started writing .NET apps I was very used to CF's XFormat() functions where the mask was always last. The mask comes first in VB's date formatter and when I put it last, the mask was actually displayed like you're descriing. I THINK CF would throw an error if it were backwards but it's worth checking. Just seems very odd that it displays the mask. You might also consider posting the bit of code that is displaying the mask so everyone can take a look. ..:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Jean-Baptiste Emanuel Zorg [mailto:[EMAIL PROTECTED] Sent: Sunday, October 23, 2005 11:32 PM To: CF-Talk Subject: Re: formatting a date in cfgrid it's just a regular date/time field always figured i could do it on the front end somehow.. i'll give that a lookig into though.. thanks On 10/23/05, Alan Rother [EMAIL PROTECTED] wrote: This is just totally off the cuff here... But if you can't get CF to do it right off, you could have your DB do it. Just apply a date mask to it in the query. Most DB systems allow you to do this. HTH Alan Rother Macromedia Certified Advanced ColdFusion MX 7 Developer On 10/23/05, Jean-Baptiste Emanuel Zorg [EMAIL PROTECTED] wrote: i have a date that is populating a field in a grid like this: Tue Oct 18 21:25:48 GMT-0400 2005 i have attempted to use mask= D, but all it does is output the mask to the field.. any ideas how to mask this? thanks ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:222022 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
formatting a date in cfgrid
i have a date that is populating a field in a grid like this: Tue Oct 18 21:25:48 GMT-0400 2005 i have attempted to use mask= D, but all it does is output the mask to the field.. any ideas how to mask this? thanks ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:222002 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: formatting a date in cfgrid
This is just totally off the cuff here... But if you can't get CF to do it right off, you could have your DB do it. Just apply a date mask to it in the query. Most DB systems allow you to do this. HTH Alan Rother Macromedia Certified Advanced ColdFusion MX 7 Developer On 10/23/05, Jean-Baptiste Emanuel Zorg [EMAIL PROTECTED] wrote: i have a date that is populating a field in a grid like this: Tue Oct 18 21:25:48 GMT-0400 2005 i have attempted to use mask= D, but all it does is output the mask to the field.. any ideas how to mask this? thanks ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:222004 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: formatting a date in cfgrid
it's just a regular date/time field always figured i could do it on the front end somehow.. i'll give that a lookig into though.. thanks On 10/23/05, Alan Rother [EMAIL PROTECTED] wrote: This is just totally off the cuff here... But if you can't get CF to do it right off, you could have your DB do it. Just apply a date mask to it in the query. Most DB systems allow you to do this. HTH Alan Rother Macromedia Certified Advanced ColdFusion MX 7 Developer On 10/23/05, Jean-Baptiste Emanuel Zorg [EMAIL PROTECTED] wrote: i have a date that is populating a field in a grid like this: Tue Oct 18 21:25:48 GMT-0400 2005 i have attempted to use mask= D, but all it does is output the mask to the field.. any ideas how to mask this? thanks ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:222005 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Formatting a Date in CFGRID
I'm having trouble get the date formatted in a CFGRID column (mm/dd/yy). I tried doing this: cfgridcolumn header=Date name=#DateFormat(CourseDate,'mm/dd/yy')# And of course it won't let me get away with that. What do I need to do? Do I need to just format up in the SQL statement? could use a hint or two there also. Thanks in advance Doug Kronenberger ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4