Calendar control

Discussion in 'Questions (Windows Mobile)' started by BjornF, Jul 4, 2007.

  1. BjornF

    BjornF Active Member Licensed User

    Is there a way to change the format the calendar control uses on the form? (currently it is mm/dd/yyyy)

    DateFormat("dd/mm/yyyy") only changes the format given in the "Today:..." part when you open the control. When you select a date the result shown in the control is once again in the mm/dd/yyyy format.

    Grateful for suggestions / Björn
     
  2. alfcen

    alfcen Well-Known Member Licensed User

    Hello Björn
    I tried with
    Calendar1.Format="dd/mm/yyyy"
    Works on the desktop, but not on my device (iPAQ hx4700).
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    Can you post an example that doesn't work?
    I've checked it and it seemed to work properly.
     
  4. BjornF

    BjornF Active Member Licensed User

    Here is the code:

    Sub App_Start
    DateFormat("dd/mm/yyyy") 'this one doesn't make a difference
    Form1.Show
    End Sub

    Sub Button1_Click
    FirstTime=Date1.Value+TimeParse(Hour1.Text&":"&Min1.Text)
    SecondTime=Date2.Value+TimeParse(Hour2.Text&":"&Min2.Text)
    ResultTime=SecondTime-FirstTime
    End sub

    (dd/mm/yyyy is the default on my Pc)

    all the best / Björn
     
    Last edited: Jul 4, 2007
  5. Erel

    Erel Administrator Staff Member Licensed User

    DateFormat doesn't change the Calendar control format.
    You should use Date1.Format = "dd/mm/yyyy"
     
  6. BjornF

    BjornF Active Member Licensed User

    Thank you Alfcen and Erel, that solves the problem.

    Perhaps it could be added to the description of the Format keyword in the helpfile (for us with small imagination) :) ?

    all the best / Björn
     
  7. alfcen

    alfcen Well-Known Member Licensed User

    Erel,
    This seems to work only on the PC. Well, that could be device dependent.
     
  8. BjornF

    BjornF Active Member Licensed User

    Dear Alfcen,

    it does seem to be device dependent, at least it works on my Loox 720 (WM2003 SE).

    all the best / Björn
     
Loading...