Lasso Soft Inc. > Home

[ duration->foreachday ]

Method

[Duration->forEachDay] performs a block of code for each day between the start and end date in a duration object.

  • Syntax
Duration Object->ForEachDay => {
	Code Block
}
Examples
  • Beginner

To perform a block of code for each day between two dates in a duration:

Use the [Duration->ForEachDay] method. The following example takes two dates in a duration object, then performs a code block for each day, formatting the date as indicated.

Code

local(d) = duration(date('2011-02-21 08:00:00'),date('2011-02-24 12:00:00'))
#d->forEachDay => {^
	(#1)->format('%A, %B %-d, %Y') + '<br>'
^}

Result

Monday, February 21, 2011
Tuesday, February 22, 2011
Wednesday, February 23, 2011
Thursday, February 24, 2011

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft