Skip to content
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

ISO Date format #2994

Closed
WolfgangFahl opened this issue Feb 10, 2018 · 8 comments
Closed

ISO Date format #2994

WolfgangFahl opened this issue Feb 10, 2018 · 8 comments
Labels
enhancement Alters an existing functionality or behaviour

Comments

@WolfgangFahl
Copy link
Contributor

https://www.semantic-mediawiki.org/wiki/Help:Type_Date

shows several ways of localizing your date formats. For my international wikis I want the opposite:
I stricly only want to use ISO dateformat no matter what.

  1. How much effort would it be to have a global setting for this?
  2. Is there such an option already?
@mwjames
Copy link
Contributor

mwjames commented Feb 10, 2018

I stricly only want to use ISO dateformat no matter what.

What exactly does this mean, The query, the special pages, the annotation itself?

How much effort would it be to have a global setting for this?

Depends on the use case, if it is technical feasible, and whether this is something we want to support. Currently the described use case is unclear and therefore the technical effort is hard to estimate.

Is there such an option already?

I'm not aware of one.

@kghbln
Copy link
Member

kghbln commented Feb 10, 2018

If I interpret correctly this is about getting a configuration parameter that automatically adds #ISO to all printout request for properties of type date without actually having to add this manually in every query.

@mwjames
Copy link
Contributor

mwjames commented Feb 10, 2018

If I interpret correctly this is about getting a configuration parameter that automatically adds #ISO to all printout request for properties of type date without actually having to add this manually in every query.

If that's the case then I'm guessing you might be able to find something in [0] but I'm not so happy about the "doing it just for #ISO" (if at all), so this needs a better approach, tests, and a PR (I can review).

[0] https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/src/DataValues/ValueFormatters/TimeValueFormatter.php#L341-L356

@kghbln
Copy link
Member

kghbln commented Feb 10, 2018

I'm not so happy about the "doing it just for #ISO"

Indeed this would not make sense. One should be able to add whatever formatter to it, e.g. #MEDIAWIKI, #LOCL, etc.

@kghbln kghbln added enhancement Alters an existing functionality or behaviour good first issue Good for newcomers and removed question labels Feb 10, 2018
@WolfgangFahl
Copy link
Contributor Author

WolfgangFahl commented Feb 10, 2018

As an example see https://www.semantic-mediawiki.org/wiki/User:WolfgangFahl/Workdocumentation_2018-02-10

https://www.semantic-mediawiki.org/wiki/Property:Has_release_date
shows all date in english format to me since my "language" is english

Semantic Media Wiki 1.0 December 31, 2007

I'd rather like to see:

Semantic Media Wiki 1.0 2017-12-31
I have no option to set an "ISO" language since their seems to be no differenciation of locale and language.

{{#ask: [[Has_release_date::+]]
|?Has_release_date
}}

has the same effect. This could be changed by:
{{#ask: [[Has_release_date::+]]
|?Has_release_date#ISO
}}

but I'd rather prefer:
{{#ask: [[Has_release_date::+]]
|?Has_release_date#DEFAULT
}}

and be able to set the default globally e.g. to ISO. Better even if I don't have to specify
#DEFAULT
but this is the normal behavior and I can change the DEFAULT to e.g. USER_SPECIFIC or ISO or any fixed locale.

The same holds true for all the other internationalization issues. I do not want to bother with true/false issues and stuff like that. I'd rather for for "x","-" to avoid the issue at all instead of going with multiple translations that make life hard when working with an API.

https://www.semantic-mediawiki.org/wiki/MediaWiki:Smw_true_words
https://www.semantic-mediawiki.org/wiki/MediaWiki:Smw_false_words
has an option for this but the default has no language agnostic entry and the display format will be language dependend even if I set it. Worse this does not work for wiki farms and the changes have to be done in every single wiki of a farm and not in a central setting.

The current configurability of SMW is just great from a user experience point of view. From an API point of view it gives me so much trouble because I do not even know how to to know what representation of data I'll get - it's all configuration and wiki dependend.

@WolfgangFahl
Copy link
Contributor Author

In http://wiki.bitplan.com/index.php/Bogensport#Turniere I keep having the issue with

{#ask: [[Concept:Bogenturnier]] [[Bogenturnier date>{{CURRENTYEAR}}-{{CURRENTMONTH}}-{{CURRENTDAY}}]]

I consider using the isodate format to be the most natural thing to do but it seems not work "out-of-the-box"

@kghbln
Copy link
Member

kghbln commented Feb 12, 2019

Note that the syntax you are using is wrong. It should be [[Bogenturnier date::>{{CURRENTYEAR}}-{{CURRENTMONTH}}-{{CURRENTDAY}}]] and when things may become most natural.

@WolfgangFahl
Copy link
Contributor Author

WolfgangFahl commented Feb 12, 2019

@kghbln Thx for helping out - i fixed the page and it now does not give an error message any more and works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Alters an existing functionality or behaviour
Projects
None yet
Development

No branches or pull requests

3 participants