extensions.st
changeset 18101 c9e2739791ac
parent 18100 8be69d996009
child 18139 4f3c66d0dd31
equal deleted inserted replaced
18100:8be69d996009 18101:c9e2739791ac
  2520 !Timestamp methodsFor:'inspecting'!
  2520 !Timestamp methodsFor:'inspecting'!
  2521 
  2521 
  2522 inspectorExtraAttributes
  2522 inspectorExtraAttributes
  2523     "extra (pseudo instvar) entries to be shown in an inspector."
  2523     "extra (pseudo instvar) entries to be shown in an inspector."
  2524 
  2524 
  2525     ^ super inspectorExtraAttributes
  2525     |attrs|
       
  2526 
       
  2527     attrs := super inspectorExtraAttributes.
       
  2528     attrs
  2526         add:'-dayInWeek'   -> [ self dayInWeek printString , ' "', self asDate dayOfWeekName , '"' ];
  2529         add:'-dayInWeek'   -> [ self dayInWeek printString , ' "', self asDate dayOfWeekName , '"' ];
  2527         add:'-dayInYear'   -> [ self dayInYear ];
  2530         add:'-dayInYear'   -> [ self dayInYear ];
  2528         add:'-daysInMonth' -> [ self asDate daysInMonth ];
  2531         add:'-daysInMonth' -> [ self asDate daysInMonth ];
  2529         add:'-monthName'   -> [ self asDate monthName ];
  2532         add:'-monthName'   -> [ self asDate monthName ];
  2530         add:'-weekNr'      -> [ self asDate weekInYear ];
  2533         add:'-weekNr'      -> [ self asDate weekInYear ];
  2531         add:'-leapYear'    -> [ self asDate isLeapYear ];
  2534         add:'-leapYear'    -> [ self asDate isLeapYear ];
  2532         add:'-iso8601(utc)'-> [ self asUtcTimestamp printStringIso8601 ];
  2535         add:'-iso8601(utc)'-> [ self asUtcTimestamp printStringIso8601 ].
  2533         add:'-millisecond' -> [ self milliseconds ];
  2536     self milliseconds ~~ 0 ifTrue:[ 
  2534         add:'-microsecond' -> [ self microseconds ];
  2537         attrs add:'-millisecond' -> [ self milliseconds ].
  2535         add:'-nanosecond'  -> [ self nanoseconds ];
  2538     ].
  2536         add:'-picosecond'  -> [ self picoseconds ];
  2539     (self microseconds \\ 1000) ~~ 0 ifTrue:[ 
  2537         yourself
  2540         attrs add:'-microsecond' -> [ self microseconds ].
       
  2541     ].
       
  2542     (self nanoseconds \\ 1000000) ~~ 0 ifTrue:[ 
       
  2543         attrs add:'-nanosecond'  -> [ self nanoseconds ].
       
  2544     ].
       
  2545     (self picoseconds \\ 1000000000) ~~ 0 ifTrue:[ 
       
  2546         attrs add:'-picosecond'  -> [ self picoseconds ].
       
  2547     ].
       
  2548     ^ attrs
  2538 
  2549 
  2539     "
  2550     "
  2540      Timestamp now inspect
  2551      Timestamp now inspect
  2541     "
  2552     "
  2542 
  2553