Re: [date] formatting bug inside [orderfile]?

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 16842
interpreted = N
texte = On 3/31/1998 7:29 PM, PCS Technical Support so noted...>>outside the orderfile, date is 03/31/1998 and formatted is 03/31/98 >>inside the orderfile, date is 03/31/1998 and formatted is >>03/31/1998%m/%d/%y] >> >>A bug? A problem? Should I be setting this up differently? For the time >>being, I'll be setting the formatted date/time *outside* the [orderfile] >>and assigning it to a cart header for use inside -- but there must be a >>better way. > >In the context of an [OrderFile], the tag [date] refers to the header >variable date in the order file, essentially no different than something >like [header5]. So the symptom you're seeing is analogous to the >(incorrect) [header5 %m/%d/%y] which makes no sense to WebCatalog. > >Outside the context of an [OrderFile], [date] refers to today's date from >the server's clock. > >So you'd have to use the [Format] context to force the date into a >different format: > >[Format Days_To_Date %m/%d/%y][math]{[date]}[/math][/Format] > >The Math context converts the orderfile date to the number of days since >00/00/0000, and then the Format context converts that number to a formatted >date of your choosing.Ouch! Now I can see *why* it's doing it, but I think I'll still pass in the date from outside through a header field (since I also need to be accessing the current time, not the time the orderfile was created). I know it would probably mess up some existing sites that use the variable, but it would be nice if they were called something like orderDate and orderTime to keep them distinct. FYI, the portion of the manual that lists the header tags for the [OrderFile] context makes no mention of [date] and [time]. In the very back, under Shopping cart/order file format, the tags are shown, but not explained -- in addition to a number of other mystery tags, [CartIPAddress] [CartUsername] [CartPassword] [Precision] [TaxableShipping] [AuthNumber] [ResponseText] [Status] [BatchNumber] [ReferenceNumber] [SequenceNumber] [ItemNumber], which I imagine are primarily WebMerchant, but would be nice to have more of an explanation of, especially [CartUsername] and [CartPassword] which I think a few other people on the list are looking for additional data on as well.With [Format Days_To_Date %m/%d/%y], is Days_To_Date a math variable I'm creating, or a function of the [format] tag? I could find no mention of that either.Rob Marquardt Designer/Resident Wirehead Toast Design300 First Avenue North, Suite 150 Minneapolis MN 55401 612.330.9863 v 612.321.9424 f www.toastdesign.com Associated Messages, from the most recent to the oldest:

    
  1. Re: [date] formatting bug inside [orderfile]? (Rob Marquardt 1998)
  2. Re: [date] formatting bug inside [orderfile]? (PCS Technical Support 1998)
  3. [date] formatting bug inside [orderfile]? (Rob Marquardt 1998)
On 3/31/1998 7:29 PM, PCS Technical Support so noted...>>outside the orderfile, date is 03/31/1998 and formatted is 03/31/98 >>inside the orderfile, date is 03/31/1998 and formatted is >>03/31/1998%m/%d/%y] >> >>A bug? A problem? Should I be setting this up differently? For the time >>being, I'll be setting the formatted date/time *outside* the [orderfile] >>and assigning it to a cart header for use inside -- but there must be a >>better way. > >In the context of an [orderfile], the tag [date] refers to the header >variable date in the order file, essentially no different than something >like [header5]. So the symptom you're seeing is analogous to the >(incorrect) [header5 %m/%d/%y] which makes no sense to WebCatalog. > >Outside the context of an [orderfile], [date] refers to today's date from >the server's clock. > >So you'd have to use the [format] context to force the date into a >different format: > >[Format Days_To_Date %m/%d/%y][math]{[date]}[/math][/Format] > >The Math context converts the orderfile date to the number of days since >00/00/0000, and then the Format context converts that number to a formatted >date of your choosing.Ouch! Now I can see *why* it's doing it, but I think I'll still pass in the date from outside through a header field (since I also need to be accessing the current time, not the time the orderfile was created). I know it would probably mess up some existing sites that use the variable, but it would be nice if they were called something like orderDate and orderTime to keep them distinct. FYI, the portion of the manual that lists the header tags for the [orderfile] context makes no mention of [date] and [time]. In the very back, under Shopping cart/order file format, the tags are shown, but not explained -- in addition to a number of other mystery tags, [CartIPAddress] [CartUsername] [CartPassword] [Precision] [TaxableShipping] [AuthNumber] [ResponseText] [Status] [BatchNumber] [ReferenceNumber] [SequenceNumber] [ItemNumber], which I imagine are primarily WebMerchant, but would be nice to have more of an explanation of, especially [CartUsername] and [CartPassword] which I think a few other people on the list are looking for additional data on as well.With [Format Days_To_Date %m/%d/%y], is Days_To_Date a math variable I'm creating, or a function of the [format] tag? I could find no mention of that either.Rob Marquardt Designer/Resident Wirehead Toast Design300 First Avenue North, Suite 150 Minneapolis MN 55401 612.330.9863 v 612.321.9424 f www.toastdesign.com Rob Marquardt

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Nesting Search Within Tag? (1997) WCS Newbie question (1997) shipping code (1998) Bug In Admin Templates (2003) Mac 2.1b2 speed (1997) (1999) [WebDNA] Bug in 6.2? (2009) Pithy questions on webcommerce & siteedit (1997) WebCat2 several catalogs? (1997) Email within tmpl ? (1997) WebCat2b12--[searchstring] bug (1997) Problems with SELECT MULTIPLE (1999) Email check problems -1 (1999) WebCatalog for Postcards ? (1997) WebCat2b12 CGI Mac - [shownext] problem (1997) Mozilla/4. and Browser Info.txt (1997) E-mail loop ! (1997) RE: Error: template (1997) [taxrate] question (1997) [WebDNA] Hmmm ... (2008)