Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Visualisierung
    4. Datum (TT.MM.YY) in (kurzen) Wochentag umwandeln

    NEWS

    • Neues Video "KI im Smart Home" - ioBroker plus n8n

    • Neues Video über Aliase, virtuelle Geräte und Kategorien

    • Wir empfehlen: Node.js 22.x

    Datum (TT.MM.YY) in (kurzen) Wochentag umwandeln

    This topic has been deleted. Only users with topic management privileges can see it.
    • hollywoot
      hollywoot last edited by

      Moin,

      ich hab jetzt schon eine Weile gesucht und irgendwie nichts finden können.
      Ich nutze den Feiertage-Adapter und würde mir gerne im VIS den entsprechenden Wochentag anzeigen lassen bzw. nur dann anzeigen lassen, wenn es ein "freier Feiertag" ist (kein Wochenende).

      Leider krieg ich es nicht gebacken, dass Datum von feiertage.0.naechster.Datum in einen Wochentag umzuwandeln.

      Kann wer helfen?

      Gruß

      liv-in-sky haus-automatisierung 2 Replies Last reply Reply Quote 0
      • liv-in-sky
        liv-in-sky @hollywoot last edited by

        @hollywoot

        z.b.

        Image 043.png

        <xml xmlns="https://developers.google.com/blockly/xml">
         <variables>
           <variable id="GpO@GGfL#bemhI0d^!]d">myDate</variable>
         </variables>
         <block type="variables_set" id="39PkC).J6`Z*u6MO{.M@" x="-12" y="288">
           <field name="VAR" id="GpO@GGfL#bemhI0d^!]d">myDate</field>
           <value name="VALUE">
             <block type="lists_split" id="syF^umB{Y!%T6wQ^b#$K">
               <mutation mode="SPLIT"></mutation>
               <field name="MODE">SPLIT</field>
               <value name="INPUT">
                 <block type="get_value" id="s)cfxbUIbQiT8,KyBP|g">
                   <field name="ATTR">val</field>
                   <field name="OID">feiertage.0.naechster.Datum</field>
                 </block>
               </value>
               <value name="DELIM">
                 <shadow type="text" id="IZAurv-_DI.{F_v:$+#G">
                   <field name="TEXT">.</field>
                 </shadow>
               </value>
             </block>
           </value>
           <next>
             <block type="debug" id="u|IQ1U}H-GvkaN[+8,+(">
               <field name="Severity">log</field>
               <value name="TEXT">
                 <shadow type="text" id="@4i.^jn`C}5Zn%Iv:=bN">
                   <field name="TEXT">test</field>
                 </shadow>
                 <block type="convert_from_date" id="=^?~_S-gKz!8nb5:l68Y">
                   <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="true"></mutation>
                   <field name="OPTION">wdt</field>
                   <field name="LANGUAGE">de</field>
                   <value name="VALUE">
                     <block type="text_join" id="bc8s?|{,*.AKpq=X3c01">
                       <mutation items="5"></mutation>
                       <value name="ADD0">
                         <block type="lists_getIndex" id="$MhH:J_[^}Pp~;vDf6Yk">
                           <mutation statement="false" at="true"></mutation>
                           <field name="MODE">GET</field>
                           <field name="WHERE">FROM_START</field>
                           <value name="VALUE">
                             <block type="variables_get" id="_gbIBcMtWl-]i4Uip8kM">
                               <field name="VAR" id="GpO@GGfL#bemhI0d^!]d">myDate</field>
                             </block>
                           </value>
                           <value name="AT">
                             <block type="math_number" id=",sCbBip2plZg,Y~H$RWc">
                               <field name="NUM">3</field>
                             </block>
                           </value>
                         </block>
                       </value>
                       <value name="ADD1">
                         <block type="text" id="D!DFI~Hv9:j{eVB[3GTt">
                           <field name="TEXT">-</field>
                         </block>
                       </value>
                       <value name="ADD2">
                         <block type="lists_getIndex" id="y.x2dZCi$-|;(e8M?0pJ">
                           <mutation statement="false" at="true"></mutation>
                           <field name="MODE">GET</field>
                           <field name="WHERE">FROM_START</field>
                           <value name="VALUE">
                             <block type="variables_get" id="]B6QxjZp2mkK6rq|:j+-">
                               <field name="VAR" id="GpO@GGfL#bemhI0d^!]d">myDate</field>
                             </block>
                           </value>
                           <value name="AT">
                             <block type="math_number" id="J2NY~|rp9Ac,Eu~,b88o">
                               <field name="NUM">2</field>
                             </block>
                           </value>
                         </block>
                       </value>
                       <value name="ADD3">
                         <block type="text" id="zm|ur,_?jUMO`N.%gyu@">
                           <field name="TEXT">-</field>
                         </block>
                       </value>
                       <value name="ADD4">
                         <block type="lists_getIndex" id="K;@Hm]F0*tH29aSKuHu{">
                           <mutation statement="false" at="true"></mutation>
                           <field name="MODE">GET</field>
                           <field name="WHERE">FROM_START</field>
                           <value name="VALUE">
                             <block type="variables_get" id="[,9ihy@!:v73#9W?JT;A">
                               <field name="VAR" id="GpO@GGfL#bemhI0d^!]d">myDate</field>
                             </block>
                           </value>
                           <value name="AT">
                             <block type="math_number" id="1=mM4e=xh}Q3|Uo[vh/V">
                               <field name="NUM">1</field>
                             </block>
                           </value>
                         </block>
                       </value>
                     </block>
                   </value>
                 </block>
               </value>
             </block>
           </next>
         </block>
        </xml>
        

        hollywoot 1 Reply Last reply Reply Quote 1
        • hollywoot
          hollywoot @liv-in-sky last edited by

          @liv-in-sky
          Gott, da wäre ich im Leben nicht drauf gekommen.
          Er möchte also gerne das Minus als Trennzeichen, ja? 🙂

          Ich danke Dir!

          paul53 1 Reply Last reply Reply Quote 0
          • haus-automatisierung
            haus-automatisierung Developer Most Active @hollywoot last edited by haus-automatisierung

            @hollywoot z.B. mit einem Alias in alias.0. Als Lese-Funktion dann

            new Intl.DateTimeFormat('de-DE', { weekday: 'long' }).format(new Date(val))
            // Dienstag
            

            oder

            new Intl.DateTimeFormat('de-DE', { weekday: 'short' }).format(new Date(val))
            // Di
            

            Edit: Funktioniert beim Feiertage-Adapter leider nicht, da das Datum als String im Deutschen Format gespeichert wird...

            1 Reply Last reply Reply Quote 0
            • paul53
              paul53 @hollywoot last edited by paul53

              @hollywoot sagte: Minus als Trennzeichen, ja?

              Die Reihenfolge "TT.MM.JJJJ" wird falsch interpretiert. Man muss sie umkehren "JJJJ-MM-TT". Es ginge z.B. auch "MM/TT/JJJJ" oder "MM.TT.JJJJ" und sogar "MM/TT/JJ".

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              Support us

              ioBroker
              Community Adapters
              Donate

              919
              Online

              32.1k
              Users

              80.7k
              Topics

              1.3m
              Posts

              4
              5
              406
              Loading More Posts
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes
              Reply
              • Reply as topic
              Log in to reply
              Community
              Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
              The ioBroker Community 2014-2023
              logo