Page MenuHomePhabricator

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

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 created this task.Dec 5 2014, 1:02 PM
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 added a subscriber: Tpt.
Lydia_Pintscher triaged this task as Normal priority.Dec 5 2014, 4:35 PM
Lydia_Pintscher added a project: patch-welcome.

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).

revi added a subscriber: revi.Dec 12 2014, 10:13 AM
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

This was requested again today.

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 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! :-)

jhsoby added a subscriber: jhsoby.Feb 18 2016, 9:41 PM
Jc3s5h added a subscriber: Jc3s5h.Jun 2 2016, 1:05 PM
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptJun 2 2016, 1:06 PM
Jc3s5h removed a subscriber: Jc3s5h.Aug 12 2016, 7:17 PM

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