-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Major rewrite of TimeFormatter #49
Conversation
b646f8c
to
abfb175
Compare
|
||
/** | ||
* @deprecated since 0.7, use \ValueParsers\TimeParser::CALENDAR_JULIAN instead. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the advantage of having this in the parser instead of the formatter? How about putting it in the value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. If the constant is needed in both, these two options seem equality arbitrary to me. It's also rather odd to have the formatter depend on the parser or the other way around. Also consider that it's not actually the time formatter or the time parser, rather a time formatter and a time parser.
Unless the value uses the constants, it'd not put them in there. How about creating a dedicated enum like construct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with pretty much every solution, but this is unrelated to this patch. The two constants in TimeFormatter are not used any more in TimeFormatter with my patch. They need to be deprecated no matter what.
@adrianheine, @JeroenDeDauw: I reworked this patch completely. Now it's an actual formatter. A "basic, language-independent TimeValue to plain text formatter". The way to generic class name still needs a rename. Will do this after this is merged.
|
a3ed93e
to
edaf292
Compare
Done. The actual changes in this patch are:
|
c617841
to
94769b6
Compare
94769b6
to
36bdc1b
Compare
ff8bb83
to
d2ce3a8
Compare
41762f1
to
9151de5
Compare
Needs a rebase! |
9151de5
to
920474f
Compare
920474f
to
ef15e03
Compare
ef15e03
to
69c6661
Compare
69c6661
to
b8c8002
Compare
b8c8002
to
806fbbb
Compare
$formatted = $value->getTime(); | ||
$formatted = $this->getFormattedTimestamp( $value ); | ||
// FIXME: Temporarily disabled. | ||
//$formatted .= ' (' . $this->getFormattedCalendarModel( $value->getCalendarModel() ) . ')'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we fix this before merging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We removed this temporarily to have less confusing information in diffs. If we all agree what the calendar model means, and we all agree that this consensus should be visible to our users, then yes, this line should be enabled. On the other hand: This formatter is currently not used. We use the HTML formatter instead.
I would like to discuss this in an other pull request and merge this as it is. This plain text formatter is primarily meant as a fall back for external users of our libraries.
Why was this not merged in 0.8.2? What's so confusing about this simple enhancement that it's still sitting here after more than 6 months? I don't get that and it makes me sad and angry. What should I do? Close this and reopen it as a new pull request, where it does not have any confusing comments? Split it into so many smaller patches that people start complaining about to many untracked patches? Open tickets on Phabricator that will never be added to a sprint? What should I do to get out of the frustrating situation that finished patches that don't need any discussion get stuck forever? |
806fbbb
to
531c4df
Compare
531c4df
to
a56faa9
Compare
Closing very old PRs |
Bug: T63958
Bug: T85324Bug: T92265