﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
23375	Mapcss: allow retrieving current year	Famlam	team	"==== What steps will reproduce the problem?
Have (custom) mapcss validator rules that check for e.g.:
- `start_date`s in the future (e.g. `start_date=2103` instead of `2013`)
- `opening_date`s on `*=construction` objects in the past (`building=construction + opening_date=2020-04-22`)
- `*:conditional`s expired in the past (e.g. `bicycle:conditional = no @ (2021 Nov 22 - 2021 Dec 04)`)
Have to update these rules every year to adjust their year.

==== What is the expected result?
It would be great to have a mapcss function that can just return current year as an integer (according to the users operating system and corresponding time zone should be good enough for 99.99999% of the cases).

That way, the aforementioned use cases can be used without yearly manual update. (All other parts of the rules can be dealt with via e.g. `regexp_match`, `to_int`, adding or subtracting years, sorting (in absence of `min()`/`max()` functions), etc...)

==== What happens instead?
Every year at Jan 1, update all year-dependent rules manually

==== Please provide any additional information below. Attach a screenshot if possible.

{{{
Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2023-12-22 12:48:53 +0100 (Fri, 22 Dec 2023)
Revision:18924
Build-Date:2023-12-23 02:31:03
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (18924 nl) Windows 10 64-Bit
OS Build number: Windows 10 Home 2009 (19045)
Memory Usage: 576 MB / 2012 MB (179 MB allocated, but free)
Java version: 17.0.9+8-LTS, Azul Systems, Inc., OpenJDK 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1920×1080 (scaling 1.10×1.10)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→32×32, 32×32→32×32
System property file.encoding: Cp1252
System property sun.jnu.encoding: Cp1252
Locale info: nl_NL
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-Djpackage.app-version=1.5.18906, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED, --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED, --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED, --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED, --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED, -Djpackage.app-path=%UserProfile%\AppData\Local\JOSM\JOSM.exe]

Plugins:
+ OpeningHoursEditor (36126)
+ imagery_offset_db (36126)
+ pbf (36176)
+ pt_assistant (632)
+ reverter (36126)
+ tageditor (36126)
+ turnlanes-tagging (0.0.5)
+ undelete (36126)
+ utilsplugin2 (36178)

Map paint styles:
+ https://josm.openstreetmap.de/josmfile?page=Styles/Potlatch2&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1
+ %UserProfile%\Documents\tijdelijke bestanden\josm-eigen.mappaint.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Styles/Sidewalks&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/ParkingLanes&zip=1

Validator rules:
+ %UserProfile%\Documents\tijdelijke bestanden\josm-eigen.validator.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Rules/SuspiciousSwimming_Pool&zip=1
+ https://raw.githubusercontent.com/osm-fr/osmose-backend/master/plugins/TagFix_Destination.validator.mapcss
+ https://raw.githubusercontent.com/osm-fr/osmose-backend/master/plugins/Colour.validator.mapcss
+ https://raw.githubusercontent.com/osm-fr/osmose-backend/master/plugins/notprefix.validator.mapcss
+ https://raw.githubusercontent.com/osm-fr/osmose-backend/master/plugins/TagFix_MultipleTag2.validator.mapcss
+ https://raw.githubusercontent.com/Famlam/OsmMapcssValidationNL/main/netherlands.validator.mapcss

Last errors/warnings:
- 00000.538 W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF'
- 00000.540 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF'
- 00000.995 E: java.security.KeyStoreException: Windows-ROOT not found. Oorzaak: java.security.NoSuchAlgorithmException: Windows-ROOT KeyStore not available
}}}
"	enhancement	new	normal		Core validator			template_report year mapcss date	
