Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

days-up-to-month - returns the number of days in a year, preceding the given month. (See related posts)

   1  
   2  days-in-months: [31 28 31 30 31 30 31 31 30 31 30 31]
   3  days-in-months-leap: head change at copy days-in-months 2 29
   4  
   5  days-up-to-month: func [month /in year] [
   6      sum copy/part either leap-year?/with any [year now] [days-in-months-leap] [days-in-months] month - 1
   7  ]

You need to create an account or log in to post comments to this site.


Click here to browse all 5545 code snippets

Related Posts