#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Sun, 26 May 2019 12:00:09 +0200
changeset 24161 cfa3f53b41d9
parent 24160 93d4db241317
child 24162 c13b7c624a38
#FEATURE by cg class: Date class added: #year:day:
Date.st
--- a/Date.st	Sun May 26 11:59:50 2019 +0200
+++ b/Date.st	Sun May 26 12:00:09 2019 +0200
@@ -1065,8 +1065,24 @@
     "
 
     "Created: / 09-01-2019 / 18:17:28 / Claus Gittinger"
+!
+
+year:year day:dayInYear
+    "return a new Date, given the year and the day-in-year (starting at 1).
+     See also: Date today / Time now / Timestamp now.
+     Squeak compatibility"
+
+    ^ self newDay:dayInYear year:year
+
+    "
+     self year:1970 day:1
+     self year:2000 day:1
+    "
+
+    "Created: / 26-05-2019 / 11:57:36 / Claus Gittinger"
 ! !
 
+
 !Date class methodsFor:'change & update'!
 
 update:something with:aParameter from:changedObject
@@ -2038,6 +2054,7 @@
     "Modified: 8.10.1996 / 19:25:39 / cg"
 ! !
 
+
 !Date class methodsFor:'private'!
 
 dayAbbrevsForLanguage:languageOrNilForDefault
@@ -2266,6 +2283,8 @@
     "
 ! !
 
+
+
 !Date methodsFor:'Compatibility-ANSI'!
 
 dayOfWeek
@@ -3461,6 +3480,7 @@
 ! !
 
 
+
 !Date methodsFor:'obsolete'!
 
 asAbsoluteTime
@@ -3531,6 +3551,7 @@
     ^ self addDays:days
 ! !
 
+
 !Date methodsFor:'printing & storing'!
 
 addPrintBindingsTo:aDictionary