9 Replies Latest reply on Nov 8, 2012 2:52 AM by raybaudi

    Change drop-down calendar default date display?

    jmcroteau

      Title

      Change drop-down calendar default date display?

      Post

           By default, drop-down calendars display the system date. With two calendars, let's call them StartDate and EndDate, how can I have the EndDate drop-down calendar display the selected date from the StartDate field, but without entering a date unless the user does select one?

           Our users find it annoying when they select a StartDate months away from today to have to navigate in the EndDate calendar to that period before being able to select the EndDate. On my end, I do not want the EndDate to be automatically entered, I only want this to be done by the user.

        • 1. Re: Change drop-down calendar default date display?
          schamblee

               Depending on your how your app works. You could just setup an Auto-Enter on the EndDate field.   Check the calculated value and then enter StartDate

               or

               You may need to use a script trigger onObjectModify (StartDate) which would run a script to set field EndDate to StartDate.

          • 2. Re: Change drop-down calendar default date display?
            philmodjunk

                 To expand on that, What S Chamblee suggests should not cause any major issues with your scripts set to use these to dates to find records within the specified date range.

            • 3. Re: Change drop-down calendar default date display?
              raybaudi

                   You could set the EndDate to auto-enter a value based on this calc:


                   Case(
                   Get ( ActiveFieldName ) = "EndDate" ; Self ;
                   StartDate
                   )

              • 4. Re: Change drop-down calendar default date display?
                jmcroteau

                     Unless I get it wrong, the script trigger enters a date in the EndDate field, which is not wanted. Also, if at a later time the StartDate is modified, it triggers a modification to EndDate; with the auto-enter calculation, it is impossible to leave the field blank. However, I think you pointed me in the right direction.  I added a boolean to the script:

                     If [IsEmpty (Dates ::EndDate) ]

                                     Set Field [Dates ::EndDate; Dates ::StartDate]

                     End If

                     I am halfway there. Entering a date in the first field makes the second one to navigate to the same date; modifying the 1st field does not modify the 2nd one. But I still get this automatic entry in the second field, which is not desirable...

                • 5. Re: Change drop-down calendar default date display?
                  philmodjunk
                       

                            Unless I get it wrong, the script trigger enters a date in the EndDate field, which is not wanted.

                       Why is this not wanted? What problems does this cause for you? Any that I can guess at all seem pretty easy to adjust for.

                  • 6. Re: Change drop-down calendar default date display?
                    jmcroteau

                         I have a series of drop-down calendars, related to events planning:

                           
                    •           “order” (auto-enter creation date)
                    •      
                    •           “ship to”
                    •      
                    •           “target delivery”
                    •      
                    •           “installation start”
                    •      
                    •           “installation end”
                    •      
                    •           “show open”
                    •      
                    •           “show end”
                    •      
                    •           “dismantling start”
                    •      
                    •           “dismantling end”
                    •      
                    •           “ship from”

                          

                         As mentioned in the original post, when you click an empty drop-down calendar, it displays today’s date by default (without entering it). When preparing an order for an event where the “target move-in date” is, for example, September 10, 2013, users must navigate in each of the following drop-down calendars from today’s date to September 2013 to enter data. It is, to say the least, annoying and why I would like these calendars to automatically navigate to September 2013 once the “target move-in date” is entered.

                         At the same time, since some of the other dates may not be known when the order is created, I don’t want any dates (besides the order date) to be automatically created.

                    • 7. Re: Change drop-down calendar default date display?
                      schamblee

                           On the EndDate field  set a script trigger onObjectEnter then in your script would be 

                           If[IsEmpty(EndDate)]

                              set field [EndDate;StartDate]

                           Endif

                           You could do this for each field and just change Endate to the name of the other date fields.

                            

                      • 8. Re: Change drop-down calendar default date display?
                        philmodjunk

                             Again, this does not look to me like a major problem. There are any number of ways to adjust your layout design to adapt for a default value in the "end date" fields that exactly matches the start date fields. One simple option is to use conditional formatting to make the contents of the end date field invisible if their value equals the value in the start date field.

                        • 9. Re: Change drop-down calendar default date display?
                          raybaudi

                                

                          "how can I have the EndDate drop-down calendar display the selected date from the StartDate field, but without entering a date unless the user does select one?"
                                
                               I have found a way to do what you asked ( empty EndDate field with same calendar month and year of StartDate ).
                               It uses two triggers ( OnObjectEnter and OnObjectValidate ).
                               I could post an example but I need to know if EndDate could ever be minor or equal to StartDate.