Modify

Opened 2 years ago

Last modified 2 years ago

#22778 new enhancement

reconsider mapcss function osm_timestamp()

Reported by: Klumbumbus Owned by: team
Priority: normal Milestone:
Component: Core mappaint Version:
Keywords: Cc: mikeho

Description

For https://www.openstreetmap.org/api/0.6/node/4471457459 the mapcss function osm_timestamp() returns an integer number (1477838904) which is not really useful I guess.
It would be better if it would return the human readable format (2016-10-30T14:48:24Z)

Attachments (0)

Change History (5)

comment:1 by Klumbumbus, 2 years ago

Cc: mikeho added

comment:2 by taylor.smock, 2 years ago

If this change is made, we'd probably want to be able to parse timestamp values as well, e.g.

way[osm_timestamp() < "2016-11-01T00:00:00Z"] {
  // Do something
}

I don't think we currently do so.

comment:3 by stoecker, 2 years ago

Why is the integer not helpful?

comment:4 by mikeho, 2 years ago

JOSM, Window: "History for way/node <number>" ( Ctrl + h ) shows the text "Version 3 created on 1/20/20 6:16 PM". This is more understandable for humans than "Version 3 created on 1615578551". In a MapCSS it is the same. That's why we need a function that outputs the osm_timestamp as a formatted string, for example osm_timestamp_formated_string() ( like the strftime() function ).

The format "2016-10-30T14:48:24Z" can be an alternative to national date formats like "30.10.2023, 14:48:24 Z".

node[...]::layer_xyz { ...  text: concat("Last edit by ", osm_user_name(), " on ", osm_timestamp_formated_string() ); ... }

The result "Last edit by mikeho on 2016-10-30T14:48:24Z" is easy to understand. "Last edit by mikeho on 161030123" says nothing to humans.

Last edited 2 years ago by mikeho (previous) (diff)

in reply to:  3 comment:5 by Klumbumbus, 2 years ago

Replying to stoecker:

Why is the integer not helpful?

For "human reading" it is useless. If it can be used for sorting or something like that, then 2 functions would be the best.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to Klumbumbus.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.