« Return to Thread: Easiest way to present Dates

Re: Easiest way to present Dates

by Lukas Renggli-2 :: Rate this Message:

Reply to Author | View in Thread

> BlockContext-write: anObject description: aDescription

>
>    ^ self value: anObject
>
> The following becomes possible:
>
>    ^ MADateDescription new
>        selectorAccessor: #orderDate;
>        beWithinYears: 2;
>        stringWriter: [ :i | i mmddyyyy ];
>        label: 'Order Date';
>        beReadonly;
>        beSearchable;
>        yourself
>
> Is there a better way?
> Is this worth adding to the mainstream?
This is a nice trick. I am not a big fan of unnecessarily adding block-
contexts to my model. As soon as you want to make your meta-model  
persistent or editable you run into troubles ...

What I usually did for my applications is to subclass the standard  
string writer with my configuration for dates and times to generate  
the desired output.

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch




_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki

smime.p7s (5K) Download Attachment

 « Return to Thread: Easiest way to present Dates

LightInTheBox - Buy quality products at wholesale price