Re: [Pharo-users] Date text converter/formatter

2014-09-03 Thread stepharo
That is why the formatter/parser was written in the first place ;-) It is modelled after a Go standard library (http://golang.org/src/pkg/time/format.go) and some Ruby library I can't remember the name of. I implemented this as a proof of concept to see if/how it could be done. Hi sven and th

Re: [Pharo-users] Date text converter/formatter

2014-09-03 Thread Ben Coman
Sven Van Caekenberghe wrote: On 03 Sep 2014, at 15:24, Ben Coman wrote: Sven Van Caekenberghe wrote: Hi Sean, On 03 Sep 2014, at 00:32, Sean P. DeNigris wrote: Sven Van Caekenberghe-2 wrote Maybe you

Re: [Pharo-users] Date text converter/formatter

2014-09-03 Thread Sven Van Caekenberghe
On 03 Sep 2014, at 15:44, Esteban A. Maringolo wrote: > Esteban A. Maringolo > > > 2014-09-02 17:46 GMT-03:00 Sven Van Caekenberghe : >> >> On 02 Sep 2014, at 21:39, Esteban A. Maringolo wrote: >> >>> Thank you. It is certainly better than the base parser. >>> But for formats I can't pass D

Re: [Pharo-users] Date text converter/formatter

2014-09-03 Thread Sven Van Caekenberghe
On 03 Sep 2014, at 15:24, Ben Coman wrote: > Sven Van Caekenberghe wrote: >> Hi Sean, >> >> On 03 Sep 2014, at 00:32, Sean P. DeNigris >> >> wrote: >> >> >>> Sven Van Caekenberghe-2 wrote >>> >>> Maybe you got the example and the input mixed up ? >>> Oh yeah,

Re: [Pharo-users] Date text converter/formatter

2014-09-03 Thread Esteban A. Maringolo
Esteban A. Maringolo 2014-09-02 17:46 GMT-03:00 Sven Van Caekenberghe : > > On 02 Sep 2014, at 21:39, Esteban A. Maringolo wrote: > >> Thank you. It is certainly better than the base parser. >> But for formats I can't pass Date objects to #format:, I have to >> convert them to ZTimestamp before.

Re: [Pharo-users] Date text converter/formatter

2014-09-03 Thread Ben Coman
Sven Van Caekenberghe wrote: Hi Sean, On 03 Sep 2014, at 00:32, Sean P. DeNigris wrote: Sven Van Caekenberghe-2 wrote Maybe you got the example and the input mixed up ? Oh yeah, I did, but even the example in that case is ambiguous, no? (ZTimesta

Re: [Pharo-users] Date text converter/formatter

2014-09-03 Thread Sven Van Caekenberghe
Hi Sean, On 03 Sep 2014, at 00:32, Sean P. DeNigris wrote: > Sven Van Caekenberghe-2 wrote >> Maybe you got the example and the input mixed up ? > > Oh yeah, I did, but even the example in that case is ambiguous, no? > > (ZTimestampFormat fromString: '02/03/01 (16:05:06)') >par

Re: [Pharo-users] Date text converter/formatter

2014-09-02 Thread Sean P. DeNigris
Sven Van Caekenberghe-2 wrote > Maybe you got the example and the input mixed up ? Oh yeah, I did, but even the example in that case is ambiguous, no? (ZTimestampFormat fromString: '02/03/01 (16:05:06)') parse: '10/10/10 (12:01:01)'. How does it decide whether it's American i.e.

Re: [Pharo-users] Date text converter/formatter

2014-09-02 Thread Sven Van Caekenberghe
On 02 Sep 2014, at 23:15, Sean P. DeNigris wrote: > Esteban A. Maringolo wrote >> Curiosity #1: Why did you use an example date string instead of using >> regular patterns like , dd, hh/hh24, etc? > > I like the example concept because the user has less to remember (even if > those date pat

Re: [Pharo-users] Date text converter/formatter

2014-09-02 Thread Sean P. DeNigris
Esteban A. Maringolo wrote > Curiosity #1: Why did you use an example date string instead of using > regular patterns like , dd, hh/hh24, etc? I like the example concept because the user has less to remember (even if those date patterns are pretty well-known). Although, I noticed an example da

Re: [Pharo-users] Date text converter/formatter

2014-09-02 Thread Sven Van Caekenberghe
On 02 Sep 2014, at 21:39, Esteban A. Maringolo wrote: > Thank you. It is certainly better than the base parser. > But for formats I can't pass Date objects to #format:, I have to > convert them to ZTimestamp before. (ZTimestampFormat fromString: '2001/02/03') format: Date today. Can you give a

Re: [Pharo-users] Date text converter/formatter

2014-09-02 Thread Esteban A. Maringolo
Thank you. It is certainly better than the base parser. But for formats I can't pass Date objects to #format:, I have to convert them to ZTimestamp before. Curiosity #1: Why did you use an example date string instead of using regular patterns like , dd, hh/hh24, etc? Regards! Esteban A. Marin

Re: [Pharo-users] Date text converter/formatter

2014-09-02 Thread Sven Van Caekenberghe
Check out ZTimestampFormatter (load ConfigurationOfZTimestamp). From the class comment: === I am ZTimestampFormat, an implementation of a textual representation for a timestamp, date or time that can be used for formatting or parsing. You instanciate me by specifying the textual format by examp

[Pharo-users] Date text converter/formatter

2014-09-02 Thread Esteban A. Maringolo
Does exist an "user friendly" Date text converter and/or formatter package? I'd like to specify the format of certain dates, in the way you normally do this, it is... with a string such as 'dd/mm/' or 'dd/mmm/'. Date's #printOn:format: expects a different parameter, which seems really co