We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19604 ☆ A M B ☆
    • 179 Posts
    Hi there,
    I want my users to be able to enter a date for a product release in the Manager. The date/time TV can handle that, but allways comes with a time-field that, if not manually set, is set to the current time.

    I would like to not see the "time" at all (and maybe having it set to a fixed value like 00:00:00).
    How would that be possible?

    cheers
    Oliver
      MINDEFFECTS – DESIGN for PRINT, WEB and MEDIA
      http://twitter.com/mindeffects · http://www.facebook.com/mindeffects · http://www.youtube.com/mindeffects/ · skype://mindeffects_oliver
      • 19604 ☆ A M B ☆
      • 179 Posts
      Seems, I'll have to wait for a future release... ;-(
        MINDEFFECTS – DESIGN for PRINT, WEB and MEDIA
        http://twitter.com/mindeffects · http://www.facebook.com/mindeffects · http://www.youtube.com/mindeffects/ · skype://mindeffects_oliver
        • 3749
        • 24,544 Posts
        You could let them do it in the front end with NewsPublisher (I think). IIRC, it will let you set a default time value and I think you could leave the time field out of the form (or just hide it with JS).

        You should also be able to use a plugin in OnBeforeDocFormSave to zero out the time. In theory, you could also use a plugin attached to OnDocFormPrerender to hide that field in the Manager. I think you'd get zero in that case, though you might get the current time.

        A custom TV might be another option.
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 19604 ☆ A M B ☆
          • 179 Posts
          Quote from: BobRay at Jan 29, 2013, 08:33 PM
          A custom TV might be another option.
          I think this is the only way I really like – but in a case of liking some things second best. ;-)

          A system like MODX should be able to make such things configurable, too. I would like to see some settings for the TV on its Input tab. Other TVs drown in possible options.

          So I will make this a feature request... done: http://tracker.modx.com/issues/9473
          Maybe I'll get some supporters to help me with my humble request? ;-)

          Thanks
          Oliver

          BTW.: I did set the FR target version to 2.2.6-pl, the current release. Is that good or should it better be a "future" target version?
            MINDEFFECTS – DESIGN for PRINT, WEB and MEDIA
            http://twitter.com/mindeffects · http://www.facebook.com/mindeffects · http://www.youtube.com/mindeffects/ · skype://mindeffects_oliver
            • 4172
            • 5,888 Posts
            Its not that difficult to create a custom-TV with only a date-picker.

            See Jakos daterange-TV with an start+enddate datepicker for an example:

            https://github.com/Jako/DaterangeTV
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 3749
              • 24,544 Posts
              I think my first try would be a tiny bit of JS code injected with $modx->regClientStartupScript() in OnDocFormPrerender to do a "display:none" on the time element(s).

              If I have some extra time (pun intended) someday, I'll play with it as an extra called HideTime. wink
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 19604 ☆ A M B ☆
                • 179 Posts
                Quote from: BobRay at Jan 30, 2013, 03:05 PM
                I think my first try would be a tiny bit of JS code injected with $modx->regClientStartupScript() in OnDocFormPrerender to do a "display:none" on the time element(s).

                If I have some extra time (pun intended) someday, I'll play with it as an extra called HideTime. wink
                For the time being this would be a nice solution. Cool!
                But shouldn't MODX deliver this flexibilty by itself, I mean ”MODX Revolution Bend it any way you want.“ or what? This should also be valid for the user interface in the backend, because this is where the connection between the system and the client (customer) happens. Here MODX still is way to ”developer oriented“.
                  MINDEFFECTS – DESIGN for PRINT, WEB and MEDIA
                  http://twitter.com/mindeffects · http://www.facebook.com/mindeffects · http://www.youtube.com/mindeffects/ · skype://mindeffects_oliver
                  • 3749
                  • 24,544 Posts
                  That's a perfectly reasonable feature request - it should be part of the TV form.

                  That said, there are already at least three ways to do it (JS, plugin, and custom TV), so it probably won't be a very high priority job. wink

                  BTW, there is a OnBeforeTVFormSave event, so you should be able to zero out the time value there. I'm not sure what the variable would be. You could also get the value in OnTVFormSave, zero it out, and save the TV.


                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 19604 ☆ A M B ☆
                    • 179 Posts
                    Quote from: BobRay at Jan 30, 2013, 08:34 PM
                    That's a perfectly reasonable feature request - it should be part of the TV form.

                    That said, there are already at least three ways to do it (JS, plugin, and custom TV), so it probably won't be a very high priority job. wink
                    1.) Glad you agree. smiley
                    2.) MODX has a strong focus on developers – and lacks features for target usergroups like webdesigners, agencies and customers. If MODX really wants to ”stand in brought daylight“ it has to concentrate also on these little features that make a good workflow. Being good with the details is the things that makes the difference between ”a tool that gets the work done somehow“ and ”thats the perfect tool for the job“. But working on those small things does not give you to much credit by the others. And that is very sad. Details make the difference.
                    That being said, configurable dataTVs are an absolute must! And the good thing: implementing this should not be that tough for a developer.
                      MINDEFFECTS – DESIGN for PRINT, WEB and MEDIA
                      http://twitter.com/mindeffects · http://www.facebook.com/mindeffects · http://www.youtube.com/mindeffects/ · skype://mindeffects_oliver
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      I'm not sure that I understand the problem here. The date/time picker in the TV has two sections. You can leave the time section empty. To display the date without the time just use an output modifier:
                      [[*dateTest:strtotime:date=`%e %b %Y`]]
                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org