Calendar help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • David REMD
    Indigo Rose Customer
    • Apr 2007
    • 173

    Calendar help

    I am new to the calendar plugin. I am trying to simply populate an input with a date selected from the calendar. I am getting an error:

    Code:
    selection = Calendar.GetSelection("calendar");
    Input.SetText("Input1", selection);
    What is wrong with my code?
  • longedge
    Indigo Rose Customer
    • Aug 2003
    • 2496

    #2
    The "On Select" event of the calendar sets event variables e_StartDate and e_EndDate so if you put something like -

    Code:
    Input.SetText("Input1",e_StartDate);
    in the select event of the calendar then that will work.

    Comment

    • David REMD
      Indigo Rose Customer
      • Apr 2007
      • 173

      #3
      Thanks for your help. Now, how do I format the date as dd/mm/yyyy?

      Comment

      • longedge
        Indigo Rose Customer
        • Aug 2003
        • 2496

        #4
        One (long winded but easy to understand) way -

        Code:
        strdate=e_StartDate
        yr = String.Left(strdate, 4);
        month = String.Mid(strdate, 6, 2);
        day = String.Right(strdate, 2);
        strformatteddate = "The selected date is "..day..":"..month..":"..yr
        
        Input.SetText("Input1",strformatteddate);

        Comment

        • David REMD
          Indigo Rose Customer
          • Apr 2007
          • 173

          #5
          I have attached .apz file.

          I am trying to populate an input object with the calendar date selection from a DialogEx. Please help.
          Attached Files

          Comment

          • longedge
            Indigo Rose Customer
            • Aug 2003
            • 2496

            #6
            One way of doing it. The page timer isn't very elegant but just off the top of my head I can't think of another way.

            Comment

            • TopicTJ
              Indigo Rose Customer
              • Oct 2008
              • 63

              #7
              Here's a way of doing it without a timer.

              Also, if you download Worm's DateDiff plugin you'll find it really useful in extending the calendar functionality.


              TTJ
              Last edited by TopicTJ; 01-18-2010, 08:43 AM.
              TTJ

              Comment

              • longedge
                Indigo Rose Customer
                • Aug 2003
                • 2496

                #8
                Originally posted by TopicTJ View Post
                Here's a way of doing it without a timer.
                :yes dohhh.... number 2 braincell wasn't switched on

                Comment

                • Dermot
                  Indigo Rose Customer
                  • Apr 2004
                  • 1790

                  #9
                  or a simpler solution is to use Reteset's DateTimePicker plugin. http://www.amsplugins.com/details.asp?ID=55&CID=2
                  Dermot

                  I am so out of here :yes

                  Comment

                  • David REMD
                    Indigo Rose Customer
                    • Apr 2007
                    • 173

                    #10
                    I can't open the .rar file?

                    Comment

                    • Dermot
                      Indigo Rose Customer
                      • Apr 2004
                      • 1790

                      #11
                      Opens fine for me using WinRar
                      Dermot

                      I am so out of here :yes

                      Comment

                      • David REMD
                        Indigo Rose Customer
                        • Apr 2007
                        • 173

                        #12
                        Got it. Thank you!

                        Comment

                        • David REMD
                          Indigo Rose Customer
                          • Apr 2007
                          • 173

                          #13
                          :yesGreat plugin.

                          After much time spent; I cannot figure out the code to prevent a user from selecting a date in the past, present a dialog informing the user they cannot select a date in the past, and reset the date to today, or allow the user to continue if a valid date was selected. Anyone?

                          Comment

                          Working...
                          X