Re: [Zope] Adding days in Zope using ZopeTime
Stephan:
<dtml-if "_.round((_.DateTime.dayOfYear(ZopeTime() - _['sequence-item'])/6.88)+1) == _.round(((ZopeTime().dayOfYear())/6.88)+1)"> Perhaps to account for +/- several hours of daylight saving?
<sarcasm> You mean the above solution isn't elegant? </sarcasm>
I followed the discussion a little bit, and I think the solutions are crazy.
Me too. But the question asked for a DTML solution without modifying DateTime.
I usually install mxDateTime, since its features are far more advanced and use it with some external methods. Works just fine. (I really think, Zope should use mxDateTime. Maybe I should alter mxDateTime to have the same method names as Zope's DateTime and then replace it. That would increase the feature set by many multiples and would get rid of some of the annoying bugs with the current DateTime.)
I whole heartedly agree! Bravo. I'll bet DC would take the combined module and graft it. Why wouldn't they? The DateTime module has enough annoying little things in it (or/and lacks in just enough features) to give them a pretty constant ear ache. All my best, Jason Spisak CIO HireTechs.com 6151 West Century Boulevard Suite 900 Los Angeles, CA 90045 P. 310.665.3444 F. 310.665.3544 Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
On Fri, 28 Apr 2000, Jason Spisak wrote:
I followed the discussion a little bit, and I think the solutions are crazy.
Me too. But the question asked for a DTML solution without modifying DateTime.
I, too, have been looking at this thread. I may be a little late in this, there being still another 130 messages for me to read, but I am stunned nobody has yet found this simple solution. The original question, as i understood it, was to find the days of the current week using DTML. Essentially, this requires finding the start of the week. Some time ago, i required calculating "last tuesday", and resorted to using the day of week operator of the DateTime object. <dtml-var "_.DateTime().dow()"> if i recall correctly, this is a Sunday=0 based week. So, simply subtract that many days from the current date, and you have the start of the week. -- Have a better one, Curtis. <dtml-var standard_work_disclaimer>
participants (2)
-
Curtis Maloney -
Jason Spisak