1.18.0 - date.extract - function does not work correctly? | Page 2

Discussion in 'Archive' started by 123vak123, October 16, 2017.

  1. 123vak123

    123vak123 Portal Pro

    Joined:
    December 13, 2010
    Messages:
    176
    Likes Received:
    70
    Gender:
    Male
    Location:
    Minsk
    Ratings:
    +136 / 2
    Home Country:
    Belarus Belarus
    Show System Specs
    Thank you. I almost got what I wanted. Everything works fine, although there are some incomprehensible moments for me.


     
    • Like Like x 1
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. ajs
    • Team MediaPortal

    ajs Development Group

    Joined:
    February 29, 2008
    Messages:
    8,691
    Likes Received:
    2,674
    Gender:
    Male
    Occupation:
    IT
    Location:
    Kyiv
    Ratings:
    +4,633 / 30
    Home Country:
    Ukraine Ukraine
    Show System Specs
    ?


    --
    WBR, ajs
     
  4. 123vak123

    123vak123 Portal Pro

    Joined:
    December 13, 2010
    Messages:
    176
    Likes Received:
    70
    Gender:
    Male
    Location:
    Minsk
    Ratings:
    +136 / 2
    Home Country:
    Belarus Belarus
    Show System Specs
    Small report.
    For "videoOSD.xml" everything works almost perfectly:
    Code (Text):
    1. <define property="true" evaluateNow="true">#lenght:#(string.length(#currentremaining))</define>
    2. <define property="true" evaluateNow="true">#end1:#(date.add('n',date.extract('n',cdate(#currentremaining)), date.add('h',date.extract('h',cdate(#currentremaining)),cdate(#time))))</define>
    3. <define property="true" evaluateNow="true">#end2:#(date.add('n',date.extract('n',cdate(#currentremaining,'mm:ss')), date.add('h',date.extract('h',cdate(#currentremaining,'mm:ss')),cdate(#time))))</define>
    4. <define property="true" evaluateNow="true">#end3:#(date.add('s',date.extract('s',cdate(#currentremaining,'m:ss')), date.add('n',date.extract('n',cdate(#currentremaining,'m:ss')), date.add('h',date.extract('h',cdate(#currentremaining,'m:ss')),cdate(#time)))))</define>
    Code (Text):
    1.     <control>
    2.         <description>End1</description>
    3.         <type>label</type>
    4.         <id>0</id>
    5.             <posX>1635</posX>
    6.             <posY>1005</posY>
    7.         <label>Закончится в #(string.ltrim(#end1,'1,2,3,4,5,6,7,8,9,0,.'))</label>
    8.             <textcolor>e6e6e6</textcolor>
    9.             <font>fontB10</font>
    10.         <align>right</align>
    11.         <visible>string.equals(#lenght,7)</visible>
    12.     </control>
    13.  
    14.     <control>
    15.         <description>End2</description>
    16.         <type>label</type>
    17.         <id>0</id>
    18.             <posX>1635</posX>
    19.             <posY>1005</posY>
    20.         <label>Закончится в #(string.ltrim(#end2,'1,2,3,4,5,6,7,8,9,0,.'))</label>
    21.             <textcolor>e6e6e6</textcolor>
    22.             <font>fontB10</font>
    23.         <align>right</align>
    24.         <visible>string.equals(#lenght,5)</visible>
    25.     </control>
    26.  
    27.     <control>
    28.         <description>End3</description>
    29.         <type>label</type>
    30.         <id>0</id>
    31.             <posX>1635</posX>
    32.             <posY>1005</posY>
    33.         <label>Закончится в #(string.ltrim(#end3,'1,2,3,4,5,6,7,8,9,0,.'))</label>
    34.             <textcolor>e6e6e6</textcolor>
    35.             <font>fontB10</font>
    36.         <align>right</align>  
    37.         <visible>string.equals(#lenght,4)</visible>
    38.     </control>
    End1 - #currentremaining more than one hour, End2 - #currentremaining less than one hour, more than 10 minutes, End3 - #currentremaining less than 10 minutes.

    The "ctimespan" function could not be used - I got either an error or the current time (maybe I did not use it correctly or violated the syntax).
    The above codes work only in "videoOSD.xml". In "videoFullScreen.xml" they do not work. For "videoFullScreen.xml" work:
    Code (Text):
    1. <define property="true" evaluateNow="true">#lenght:#(string.length(#currentremaining))</define>
    2. ...
    3.     <control>
    4.         <description>End1</description>
    5.         <type>label</type>
    6.         <id>0</id>
    7.             <posX>1635</posX>
    8.             <posY>1005</posY>
    9.         <label>Закончится: #(date.add('n',date.extract('n',cdate(#currentremaining)), date.add('h',date.extract('h',cdate(#currentremaining)),cdate(#time))))</label>
    10.             <textcolor>e6e6e6</textcolor>
    11.             <font>fontB10</font>
    12.         <align>right</align>
    13.         <visible>[control.isVisible(111)|control.isVisible(10)|control.isVisible(11)|control.isVisible(12)] + string.equals(#lenght,7)</visible>
    14.     </control>
    15.  
    16.     <control>
    17.         <description>End2</description>
    18.         <type>label</type>
    19.         <id>0</id>
    20.             <posX>1635</posX>
    21.             <posY>1005</posY>
    22.         <label>Закончится: #(date.add('n',date.extract('n',cdate(#currentremaining,'mm:ss')), date.add('h',date.extract('h',cdate(#currentremaining,'mm:ss')),cdate(#time))))</label>
    23.             <textcolor>e6e6e6</textcolor>
    24.             <font>fontB10</font>
    25.         <align>right</align>
    26.         <visible>[control.isVisible(111)|control.isVisible(10)|control.isVisible(11)|control.isVisible(12)] + string.equals(#lenght,5)</visible>
    27.     </control>
    28.  
    29.     <control>
    30.         <description>End3</description>
    31.         <type>label</type>
    32.         <id>0</id>
    33.             <posX>1635</posX>
    34.             <posY>1005</posY>
    35.         <label>Закончится: #(date.add('s',date.extract('s',cdate(#currentremaining,'m:ss')), date.add('n',date.extract('n',cdate(#currentremaining,'m:ss')), date.add('h',date.extract('h',cdate(#currentremaining,'m:ss')),cdate(#time)))))</label>
    36.             <textcolor>e6e6e6</textcolor>
    37.             <font>fontB10</font>
    38.         <align>right</align>  
    39.         <visible>[control.isVisible(111)|control.isVisible(10)|control.isVisible(11)|control.isVisible(12)] + string.equals(#lenght,4)</visible>
    40.     </control>
    But in this case I can not use the function string.ltrim - getting error (0).
    Well, something like this
     
  5. 123vak123

    123vak123 Portal Pro

    Joined:
    December 13, 2010
    Messages:
    176
    Likes Received:
    70
    Gender:
    Male
    Location:
    Minsk
    Ratings:
    +136 / 2
    Home Country:
    Belarus Belarus
    Show System Specs
    There are a few more points. But their features is difficult for me to explain in Russian, and even more so in English :)
     
  6. ajs
    • Team MediaPortal

    ajs Development Group

    Joined:
    February 29, 2008
    Messages:
    8,691
    Likes Received:
    2,674
    Gender:
    Male
    Occupation:
    IT
    Location:
    Kyiv
    Ratings:
    +4,633 / 30
    Home Country:
    Ukraine Ukraine
    Show System Specs
    Yes, date.add return DateTime, string.ltrim work only with string, format DateTime to string and then use ltrim ;)



    --
    WBR, ajs
     
  7. ajs
    • Team MediaPortal

    ajs Development Group

    Joined:
    February 29, 2008
    Messages:
    8,691
    Likes Received:
    2,674
    Gender:
    Male
    Occupation:
    IT
    Location:
    Kyiv
    Ratings:
    +4,633 / 30
    Home Country:
    Ukraine Ukraine
    Show System Specs
    we can go to the Russian part of the forum and continue there.

    --
    WBR, ajs
     
  8. 123vak123

    123vak123 Portal Pro

    Joined:
    December 13, 2010
    Messages:
    176
    Likes Received:
    70
    Gender:
    Male
    Location:
    Minsk
    Ratings:
    +136 / 2
    Home Country:
    Belarus Belarus
    Show System Specs
    • Like Like x 1
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!