Christian Weiske | 17 Apr 2012 14:45
Picon
Gravatar

[PEPr] Proposal for Date and Time::Date_HumanDiff

Christian Weiske (http://pear.php.net/user/cweiske) proposes Date and Time::Date_HumanDiff.

You can find more detailed information here:
 http://pear.php.net/pepr/pepr-proposal-show.php?id=678

--

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Markus Tacker | 17 Apr 2012 13:58
Picon

Re: [PEPr] Proposal for Date and Time::Date_HumanDiff

Hoi Christian,

On Tue, Apr 17, 2012 at 14:45, Christian Weiske <cweiske <at> php.net> wrote:
> Christian Weiske (http://pear.php.net/user/cweiske) proposes Date and Time::Date_HumanDiff.

Good idea to bake this into a pear package!

- There should be an addFormat($fmt) method.
- make sure that formats is sorted by the threshold
- formats should be an entity
- get() should accept DateTime objects
- Put the english localisation in a subclass HumanDiff_EN
- Missing PHP docs in the tests file
- remove the ?> at EOF

Just my 2cents™.

-- 
  mit freundlichen Grüßen
  Markus Tacker ~ http://tckr.cc/

--

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Till Klampaeckel | 19 Apr 2012 19:45
Picon

[PEPr] Comment on Date and Time::Date_HumanDiff

I'd second what the first email said (though I don't see the comment?).

In addition:

 * it would be nice if other variants like date('r') (RFC date) are
supported

 * i'd rather see this in PEAR2 (and namespaced)

Till

-- 
http://pear.php.net/pepr/pepr-proposal-show.php?id=678

--

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Markus Tacker | 19 Apr 2012 19:50
Picon

[PEPr] Comment on Date and Time::Date_HumanDiff

Gidea to bake this into a pear package!

- There should be an addFormat($fmt) method.

- make sure that formats is sorted by the threshold

- formats should be an entity

- get() should accept DateTime objects

- Put the english localisation in a subclass HumanDiff_EN

- Missing PHP docs in the tests file

- remove the ?> at EOF

Just my 2cents™.

(Copied from my reply to the ML.)

-- 
http://pear.php.net/pepr/pepr-proposal-show.php?id=678

--

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Christian Weiske | 10 May 2012 22:18
Picon
Favicon
Gravatar

Re: [PEPr] Comment on Date and Time::Date_HumanDiff

Hello Markus and Till,

> - There should be an addFormat($fmt) method.
Done.

> - make sure that formats is sorted by the threshold
Done.

> - formats should be an entity
No, I keep them as an array - don't want to add unneeded complexity for
now.

> - get() should accept DateTime objects
Done.

> - Put the english localisation in a subclass HumanDiff_EN
No, but I've added support for translations and added a German one.
The english one is the reference "translation" provided by the
formats.

> - Missing PHP docs in the tests file
I never added docblocks in test files; there is not really a point in
my eyes.

> - remove the ?> at EOF
Why? I like them; they keep the world balanced.

> it would be nice if other variants like date('r') (RFC date)
> are supported
You can use all strtotime()-compatible strings now.
(Continue reading)

till | 11 May 2012 01:01
Picon
Gravatar

Re: [PEPr] Comment on Date and Time::Date_HumanDiff

This looks good to me – so unless you want to pear2 to it. Bring on the vote!

On Thursday, May 10, 2012 at 10:18 PM, Christian Weiske wrote:

> Hello Markus and Till,
>  
>  
> > - There should be an addFormat($fmt) method.
> Done.
>  
> > - make sure that formats is sorted by the threshold
> Done.
>  
> > - formats should be an entity
> No, I keep them as an array - don't want to add unneeded complexity for
> now.
>  
> > - get() should accept DateTime objects
> Done.
>  
> > - Put the english localisation in a subclass HumanDiff_EN
> No, but I've added support for translations and added a German one.
> The english one is the reference "translation" provided by the
> formats.
>  
> > - Missing PHP docs in the tests file
> I never added docblocks in test files; there is not really a point in
> my eyes.
>  
> > - remove the ?> at EOF
(Continue reading)

Christian Weiske | 10 May 2012 23:22
Picon
Gravatar

[PEPr] Changes in proposal for Date and Time::Date_HumanDiff

Christian Weiske (http://pear.php.net/user/cweiske) has edited the proposal for Date and Time::Date_HumanDiff.

Change comment:

version 0.2.0 with new features

Please review the proposal:
http://pear.php.net/pepr/pepr-proposal-show.php?id=678

--

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Christian Weiske | 26 May 2012 13:59
Picon
Gravatar

[PEPr] Call for votes on Date and Time::Date_HumanDiff

Christian Weiske (http://pear.php.net/user/cweiske) has initiated the call for votes on Date and Time::Date_HumanDiff.

Please review the proposal and give your vote here:
http://pear.php.net/pepr/pepr-proposal-show.php?id=678

--

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Markus Tacker | 28 May 2012 20:10
Picon

[PEPr] +1 for Date and Time::Date_HumanDiff

Markus Tacker (http://pear.php.net/user/tacker) has voted +1 on the proposal for Date and Time::Date_HumanDiff.

Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=678
Vote information:
http://pear.php.net/pepr/pepr-vote-show.php?id=678&handle=tacker

This vote is conditional. The condition is:

Very nice work.

But I have two conditions:

- get() should accept DateTime objects

- remove the ?> at EOF

--

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Christian Weiske | 28 May 2012 22:56
Picon
Favicon
Gravatar

Re: [PEPr] +1 for Date and Time::Date_HumanDiff

Hello Markus,

> Markus Tacker (http://pear.php.net/user/tacker) has voted +1 on the
> proposal for Date and Time::Date_HumanDiff.
> http://pear.php.net/pepr/pepr-proposal-show.php?id=678
>
> - get() should accept DateTime objects

It does. There is a test for that:
https://github.com/cweiske/Date_HumanDiff/blob/master/tests/Date/HumanDiffTest.php#L82

--

-- 
Regards/Mit freundlichen Grüßen
Christian Weiske

-=≡ Geeking around in the name of science since 1982 ≡=-
Markus Tacker | 29 May 2012 09:40
Favicon
Gravatar

Re: [PEPr] +1 for Date and Time::Date_HumanDiff

On Mon, May 28, 2012 at 10:56 PM, Christian Weiske <cweiske <at> cweiske.de> wrote:
> It does. There is a test for that:
> https://github.com/cweiske/Date_HumanDiff/blob/master/tests/Date/HumanDiffTest.php#L82

Ah, the protected makeTimeStamp() handles the conversion.
Then you'll just have to fix the phpdoc for get().
I've created a pull request for that:
https://github.com/cweiske/Date_HumanDiff/pull/4

-- 
  mit freundlichen Grüßen
  Markus Tacker ~ http://tckr.cc/

--

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Till Klampaeckel | 28 May 2012 20:45
Picon

[PEPr] +1 for Date and Time::Date_HumanDiff

Till Klampaeckel (http://pear.php.net/user/till) has voted +1 on the proposal for Date and Time::Date_HumanDiff.

Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=678
Vote information:
http://pear.php.net/pepr/pepr-vote-show.php?id=678&handle=till

This vote is conditional. The condition is:

Looks good.

My only gribe: can you remove the require_once statements and add an autoloader instead? People could
register it or use their own autoloader if they already have one. 

require_once calls make it a little (or a lot) harder to integrate.

Till

--

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Ken Guest | 29 May 2012 19:05
Picon
Favicon
Gravatar

[PEPr] +1 for Date and Time::Date_HumanDiff

Ken Guest (http://pear.php.net/user/kguest) has voted +1 on the proposal for Date and Time::Date_HumanDiff.

Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=678
Vote information:
http://pear.php.net/pepr/pepr-vote-show.php?id=678&handle=kguest

This vote is conditional. The condition is:

If you remove the ?> at the end, I am -1. It ought to be balanced :)

--

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Michael Gauthier | 29 May 2012 19:56
Favicon
Gravatar

[PEPr] +1 for Date and Time::Date_HumanDiff

Michael Gauthier (http://pear.php.net/user/gauthierm) has voted +1 on the proposal for Date and Time::Date_HumanDiff.

Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=678
Vote information:
http://pear.php.net/pepr/pepr-vote-show.php?id=678&handle=gauthierm

This vote is conditional. The condition is:

My vote is conditional as I have a few concerns:

1.) Method name setLocale() instead of setLanguage() makes more sense to me as you are passing in locales.
I'd rename Lang classes as Locale at the same time.

2.) Does the sort method need to be static? I'd make it protected and dynamic so it can be overridden in subclasses.

3.) In makeTimestamp you use if ($foo) { return 'a'; } else { return 'b'; }. The else is redundant. Two
separate if statements might be clearer.

4.) isIncludable() has error suppression operator which is not allowed in PEAR. Can you use file_exists +
is_readable instead?

5.) Class docs for the Lang classes would be nice.

6.) What about languages with multiple plural forms? Will this work with Slocak or Arabic? Should this
library even be responsible for translating strings? Another library like gettext or Zend_Translate
seems like a better place to handle that.

7.) Regarding the trailing ?> IIRC you're supposed to use it in PEAR 1. PEAR2 says you must not. It's not a
blocker issue for me either way.
(Continue reading)

Christian Weiske | 4 Jun 2012 16:58
Picon
Favicon
Gravatar

Re: [PEPr] +1 for Date and Time::Date_HumanDiff

Hello Michael,

> Michael Gauthier (http://pear.php.net/user/gauthierm) has voted +1 on
> the proposal for Date and Time::Date_HumanDiff.
> Vote information:
> http://pear.php.net/pepr/pepr-vote-show.php?id=678&handle=gauthierm

Thanks for the extensive review.

> 1.) Method name setLocale() instead of setLanguage() makes more sense
> to me as you are passing in locales. I'd rename Lang classes as
> Locale at the same time.
Done.

> 2.) Does the sort method need to be static? I'd make it protected and
> dynamic so it can be overridden in subclasses.
Done.

> 3.) In makeTimestamp you use if ($foo) { return 'a'; } else { return
> 'b'; }. The else is redundant. Two separate if statements might be
> clearer.
Done.

> 4.) isIncludable() has error suppression operator which is not
> allowed in PEAR. Can you use file_exists + is_readable instead?
No, sorry. I need to see if the file exists in the include path, and
using fopen + its third parameter is the pure php implementation of
that functionality.

> 5.) Class docs for the Lang classes would be nice.
(Continue reading)

Michael Gauthier | 4 Jun 2012 17:27
Favicon
Gravatar

Re: [PEPr] +1 for Date and Time::Date_HumanDiff

On 2012-06-04 11:58, Christian Weiske wrote:
> Hello Michael,
>
>
>> Michael Gauthier (http://pear.php.net/user/gauthierm) has voted +1 on
>> the proposal for Date and Time::Date_HumanDiff.
>> Vote information:
>> http://pear.php.net/pepr/pepr-vote-show.php?id=678&handle=gauthierm
>
> Thanks for the extensive review.
>
You're welcome. :)

You've addressed all my concerns and my vote is no longer conditional.

Cheers,
Mike

>
>> 1.) Method name setLocale() instead of setLanguage() makes more sense
>> to me as you are passing in locales. I'd rename Lang classes as
>> Locale at the same time.
> Done.
>
>> 2.) Does the sort method need to be static? I'd make it protected and
>> dynamic so it can be overridden in subclasses.
> Done.
>
>> 3.) In makeTimestamp you use if ($foo) { return 'a'; } else { return
>> 'b'; }. The else is redundant. Two separate if statements might be
(Continue reading)

Matthew Fonda | 30 May 2012 20:39
Picon

[PEPr] +1 for Date and Time::Date_HumanDiff

Matthew Fonda (http://pear.php.net/user/mfonda) has voted +1 on the proposal for Date and Time::Date_HumanDiff.

Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=678
Vote information:
http://pear.php.net/pepr/pepr-vote-show.php?id=678&handle=mfonda

--

-- 
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Gmane