Page MenuHomePhabricator

Allows to input of plain text such as "today" in time edit widget
Open, MediumPublic

Description

It would be nice to be able to input "today" in the time edit interface in order to get today date. It would be useful in Wikidata for properties like "date of retrieval".

Event Timeline

Tpt raised the priority of this task from to Needs Triage.
Tpt updated the task description. (Show Details)
Tpt changed Security from none to None.
Tpt subscribed.

Hmm, I thought I already filled a bug for this. Would be nice to be able to add relative things like "today", "now", "tomorrow", "yesterday" and this gets expanded to the actual date (and maybe time in the future).

Addshore renamed this task from Allows to input "today" in time edit widget to Allows to input of plain text such as "today" in time edit widget.Jan 16 2015, 1:49 PM

Should this be a fixed keyword like in SQL and programming languages, namely "now"? It would be "now" in all languages then. It may not be easy to type in certain languages. But the good thing is: Its the same everywhere, every time.

I assume we want this translated.

I suggest to not do more than the current date (and possibly time). I suggest to implement a CurrentTimeParser that understands "now" and "today" in localized as well as canonical English form. But nothing else. Not "yesterday". Not stuff like "-2 days" like it is possible in PHPs date parser. This is fairly easy.

Discussed with @Lydia_Pintscher during lunch.

  • As a server side feature this will not work as expected. The server may be in an other day than the user, resulting in the previous or next day, not the one the user expected.
  • We could take the users time zone setting into account. But this is not 100% correct in all cases, and it's not there for anonymous users. So not really a solution.
  • Conclusion: Should be a JavaScript feature.
    • Either a full featured date picker. But we should not implement our own, but reuse the OOjs core one, if it exists.
    • Or a tiny "today" button. But this should be blocked on T109457: [Story] Simplify input for dates, because adding an other button is not a good idea.

@thiemowmde +1, I only use it for sourcing stuff and that's always now! :-)

Meanwhile, a new gadget (currentDate) automatically fills in the date of today while using the property "retrieved".