We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27733
    • 99 Posts
    I have a two-pronged question regarding the calendar widget being used in the manager:

    • Can the American format be used in place of the currently-spec’d European format? If so, can the source JS (in this case, the calendar2.js file from the softcomplex distribution) be dropped into the manager/media/script/datefunctions.js without any modx-specific tweaks?
    • Can the Tigra Calendar Pro version be substituted for the current free version? The thing that’s kind of a pain now is the amount of clicking necessary when dating archive materials that go back 7-8+ years. The pro version seems to offer a little quicker navigability by allowing access to months and years via drop-down menus...
    Thanks for any suggestions!
      ------
      Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.
      • 7231
      • 4,205 Posts
      I cant answer either question. But I can offer a tip for old dates, just enter the date in the dd-mm-YYYY format (ie: 01-10-1980) and then click on the calendar button and it will open to this date and you can move from there to fine tune it.
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 27733
        • 99 Posts
        Thanks for the tip! While this works with the calendars under the Page Settings, a new calendar I added via a date TV doesn’t accept input by any other means than the calendar itself. (It’s as if the <input> field is set to read-only.)
          ------
          Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.
          • 7231
          • 4,205 Posts
          (It’s as if the <input> field is set to read-only.)
          I see what you mean. Actually this is not a field at all, the actual field is a hidden one and this is just a visual representation. I think this is done since the actual information is a timestamp. If you feel like trying to hack this the file that controls this is the manager/includes/tmplvars.inc.php starting at around line 37. I don’t know enough about JS to know how to make this change but it might simply be a matter of putting the input field in place of the ’fake’ input field.
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don&#39;t know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 7231
            • 4,205 Posts
            Actually it is simpler than I thought. You can edit out the first line of the cal section and then edit the forth one to look like this:

            $field_html .=  '		<td width="160" style="border: 1px solid #808080;"><input id="tv'.$field_name.'" name="tv'.$field_name.'" type="text" value="' . ($field_value==0 || !isset($field_value) ? "" : $field_value) . '" onblur="documentDirty=true;"> </td>';


            THis will add the input text box to the calendar which you can now enter manually in the dd-mm-YYY format, you could still add some descriptive text to make it more complete but that is up to you...I need to get a bite to eat since I am starving grin

            BTW - make a backup of the file before you edit it.
              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don&#39;t know what it is.
              Do you, Mr. Jones? - [bob dylan]
              • 27733
              • 99 Posts
              Mucho gracias for the insights & code ! I’ll give ’em a whirl. Also, on a strictly test installation, I’ll try swapping out versions of Tigra Calendar and see how/if they work ... then post the outcome.
                ------
                Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.