RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Ability to Just Show Year for Release Date?

    Scheduled Pinned Locked Moved Projects and Themes
    themesretropie theme
    15 Posts 12 Posters 5.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • PeriodicLogicP
      PeriodicLogic
      last edited by PeriodicLogic

      Looking at the theme documentation, I believe this can't be done, but figured it's worth asking.

      Is there a means to modify or adjust md_releasedate to only show the year of release?

      I'd prefer to simply be able to show the year in which the game was released, without month or day (which frequently is assumed to just be 1/1).

      I guess I could commandeer one of the text fields (probably md_publisher) and put that information there, but I'd prefer a means to automatically format the datetime result to only output the year.

      Thoughts?

      Update: It looks like a known enhancement request for emulation station. Given the apparent lack of continued development on Emulation Station, I guess I won't hold my breadth.

      mituM 1 Reply Last reply Reply Quote 4
      • I
        illando
        last edited by

        Any update about that?

        1 Reply Last reply Reply Quote 0
        • S
          sub_atomic
          last edited by

          This would be a very useful feature. It would be great if you input 19900000T000000, it would show only "1990" or 19900300T000000 would show "03/1990". This should be possible.

          1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator @PeriodicLogic
            last edited by mitu

            I think that ES will display the year only if the md_releasedate contains only the year (and not a fulldate). You'll have to modify the gamelist.xmland replace the full dates for the games metadata.

            S 1 Reply Last reply Reply Quote 0
            • ClydeC
              Clyde
              last edited by Clyde

              These commands should shorten the release date in the gamelist.xml to the first four letters. But as always, make a backup of the file before modifying it!

              xmlstarlet ed -u '//releasedate' -x 'substring(.,1,4)' gamelist.xml | less
              # code by user Marc_BlackJack_Rintsch of ubuntuuers.de released under CC BY-NC-SA 2.0 DE
              

              This won't modify the gamelist.xml, but just shows the modification in the text viewer less which you can search by typing /releasedate (enter) to highlight all <releasedate> tags for easier checking. q quits back to the command line.

              If anything seems to be in order, this command will finally modify the gamelist.xml:

              xmlstarlet ed --inplace -u '//releasedate' -x 'substring(.,1,4)' gamelist.xml
              

              If xmlstarlet isn't installed, this command will do that:

              sudo apt install xmlstarlet
              

              Although usually seen as suboptimal for editing xml files (instead of using a proper xml editor like xmlstarlet), the same can be done with the usually pre-installed text editor sed. Again, first only checking with less:

              sed -r "s/(<releasedate>.{4}).*(<\/releasedate>)/\1\2/" gamelist.xml | less
              # code by user user_unknown of ubuntuuers.de released under CC BY-NC-SA 2.0 DE
              

              And then modifying the actual file:

              sed -i.backup -r "s/(<releasedate>.{4}).*(<\/releasedate>)/\1\2/" gamelist.xml
              

              This will also save the prior state of the file in a copy with the extension ".backup".

              In the case that you wonder about the CC notes under the commands, I got them from the german Linux forum.ubuntuusers.de which puts all of its posts under the german version of the Creative Commons license Attribution-NonCommercial-ShareAlike 2.0 Generic (CC BY-NC-SA 2.0).

              1 Reply Last reply Reply Quote 0
              • K
                kixut
                last edited by

                It's an old topic but for info it's also possible in WebtroPie, clicking on the column also sorts by that column 0_1523904962846_year.png

                1 Reply Last reply Reply Quote 0
                • S
                  sub_atomic @mitu
                  last edited by

                  @mitu I tried this today, and even though my gamelist.xml has:

                  <releasedate>1999</releasedate>
                  

                  instead of the standard:

                  <releasedate>19990101T000000</releasedate>
                  

                  it still displays in ES as 01/01/1999, not 1999.

                  1 Reply Last reply Reply Quote 0
                  • E
                    EctoOne
                    last edited by EctoOne

                    A solution would be to enable <alignment> for the <datetime> element. Then we could (at least in a theme) do something link this:

                    	<datetime name="md_releasedate">
                    		<alignment>right</alignment>
                    		<size>0.4 0.08</size>
                    	</datetime>
                    

                    If the width is set properly then, it will cut of the month/day in front of the year. If no month/day is available for whatever reason, it won't mess up the design because the text is aligned to the right.
                    Maybe @jdrassa can tell us if adding this would be possible. And while I'm at it, I would also love to see <origin> added to <datetime> as well.

                    1 Reply Last reply Reply Quote 0
                    • paffleyP
                      paffley
                      last edited by

                      @EctoOne that is a brilliant idea with the 'alignment' ...thumbs up

                      1 Reply Last reply Reply Quote 0
                      • E
                        EctoOne
                        last edited by

                        I just tried to add alignment to the datetime element, but sadly it doesn't work without bigger changes (which I can't do).
                        The size of the element is determined by the content, so it won't cut off the date like other text elements do.
                        On the other hand, I submitted a pull request to finally add <origin> support to the datetime element. Something that I was missing for a long time.

                        J 1 Reply Last reply Reply Quote 0
                        • J
                          jdrassa @EctoOne
                          last edited by

                          @ectoone your PR motivated me to finally implement a revamped datetime component.

                          With this change datetime will now support all of the same options as text. In addition there will be 2 additional options displayRelative and format. displayRelative lets you choose between rendering the data vs. a relative string (ex: 5 days ago).format will allow for specifying the format of the date time (ex: <format>%Y</format> would render just the year). I will be submitting it in the next couple of days, but wanted to post here and get some feedback.

                          Branch:
                          https://github.com/jrassa/EmulationStation/tree/date-time

                          Docs:
                          https://github.com/jrassa/EmulationStation/blob/date-time/THEMES.md#datetime

                          Windows build:
                          https://ci.appveyor.com/project/jrassa/emulationstation/builds/19485339/job/01krqi9flrxtbw93/artifacts

                          Get latest build of EmulationStation for Windows here

                          E J 2 Replies Last reply Reply Quote 4
                          • E
                            EctoOne @jdrassa
                            last edited by EctoOne

                            @jdrassa Awesome. I was trying to add some more changes but I still don't understand how to use github and compile stuff. It seems that the test script from @meleu is outdated because whenever I build something with it, I got errors when I tried to run the version.
                            I then changed the original script to install ES from my fork but then I ended up with a bunch of commits which I wasn't able to figure out how to squash into one. Running RetroPie in a VM and doing the coding on my laptop wasn't a great idea too.

                            I will check out your build ASAP.

                            Edit:
                            Looks good to me. One thing that doesn't worked and broke the theme was using the <text> tag, which Is in your doc but the debug window says unsupported. I can't see any use for it anyways so you just have to remove it from the docs I guess.

                            I also have only tested it with md_releasedate and not md_lastplayed because I have my gamelists locked, so I don't have that info.

                            1 Reply Last reply Reply Quote 0
                            • foxtochopF
                              foxtochop
                              last edited by

                              I also wanted to just show the release year (without the month and day).
                              This is the first thread that comes up by searching on google.
                              I solved it:
                              Add

                              <format>%Y</format>
                              

                              to the datetime element in the theme you are using.

                              For example, mine is looking like this:

                              <datetime name="md_releasedate">
                              <format>%Y</format>
                              <pos>X.xxxxxxx X.xxxxxxxx</pos>
                              
                              DreamcastKidD 1 Reply Last reply Reply Quote 3
                              • DreamcastKidD
                                DreamcastKid Banned @foxtochop
                                last edited by

                                @foxtochop
                                Excellent ! just tried it and it does indeed work .. Thanks very much :)

                                1 Reply Last reply Reply Quote 0
                                • J
                                  jakong008 @jdrassa
                                  last edited by

                                  @jdrassa As far as my research goes with the github documentation and this thread, datetime can only be displayed in integers. Are there any workarounds to make us able to display a month to its string representation? Any leads and help are much appreciated.

                                  1 Reply Last reply Reply Quote 0
                                  • J jakong008 referenced this topic on
                                  • First post
                                    Last post

                                  Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                  Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.