extensions.st
changeset 9691 312706640f5c
parent 9673 c590ef71ca2a
child 10051 5b7e30460ea4
--- a/extensions.st	Wed Jan 19 16:08:12 2011 +0100
+++ b/extensions.st	Thu Jan 20 12:24:55 2011 +0100
@@ -119,6 +119,27 @@
     "
 ! !
 
+!Date methodsFor:'inspecting'!
+
+inspectorExtraAttributes
+    "extra (pseudo instvar) entries to be shown in an inspector."
+
+    ^ Dictionary new
+        declareAllNewFrom:(super inspectorExtraAttributes ? #());
+        add:'-dayInWeek' -> [ self dayInWeek printString , ' "', self dayOfWeekName , '"' ];
+        add:'-dayInYear' -> [ self dayInYear ];
+        add:'-daysInMonth' -> [ self daysInMonth ];
+        add:'-monthName' -> [ self monthName ];
+        add:'-leapYear' -> [ self isLeapYear ];
+        yourself
+
+    "
+     Date today inspect
+    "
+
+    "Created: / 20-01-2011 / 12:19:05 / cg"
+! !
+
 !Dictionary methodsFor:'inspecting'!
 
 inspectorClass
@@ -453,8 +474,29 @@
     "Modified: / 06-10-2006 / 13:57:38 / cg"
 ! !
 
+!Timestamp methodsFor:'inspecting'!
+
+inspectorExtraAttributes
+    "extra (pseudo instvar) entries to be shown in an inspector."
+
+    ^ Dictionary new
+        declareAllNewFrom:(super inspectorExtraAttributes ? #());
+        add:'-dayInWeek' -> [ self dayInWeek printString , ' "', self asDate dayOfWeekName , '"' ];
+        add:'-dayInYear' -> [ self dayInYear ];
+        add:'-daysInMonth' -> [ self asDate daysInMonth ];
+        add:'-monthName' -> [ self asDate monthName ];
+        add:'-leapYear' -> [ self asDate isLeapYear ];
+        yourself
+
+    "
+     Timestamp now inspect
+    "
+
+    "Created: / 20-01-2011 / 12:19:05 / cg"
+! !
+
 !stx_libtool class methodsFor:'documentation'!
 
 extensionsVersion_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/extensions.st,v 1.29 2010-12-23 15:45:22 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/extensions.st,v 1.30 2011-01-20 11:24:55 cg Exp $'
 ! !
\ No newline at end of file