1. Ong Chin Keat
  2. PowerBuilder
  3. Thursday, 15 August 2024 00:46 AM UTC

hi all,

Is powerbuilder monthcalendar control able to do date start and date end selection as similar like picture below ?

thanks,

Dev Ong

John Fauss Accepted Answer Pending Moderation
  1. Thursday, 15 August 2024 01:45 AM UTC
  2. PowerBuilder
  3. # 1

I've never used the MonthCalendar control, so I cannot say with certainty the results will appear as you have requested, but the SetSelectedRange PowerScript function can be used on a MonthCalendar control. Look for this function in PB Help. Mentioned in this Help topic is that you must set the MaxSelectedCount property prior to using the SetSelectedRange function.

Best regards, John

Comment
  1. Ong Chin Keat
  2. Thursday, 15 August 2024 03:22 AM UTC
Thanks for comment. I have wrote a simple testing script and it work for current month and and last cross week of previous month. But when try cross many months...it become crazy especially when clicked on month's scroller. My test script as below :



EVENT : dateselected



INTEGER li_return

DATE ld_temp



IF ib_st = False and ib_ed = False THEN

li_return = mc_1.GetSelectedDate ( id_start )

ib_st = True

ELSEIF ib_st = True and ib_ed = False THEN

li_return = mc_1.GetSelectedDate ( id_end )

li_return = mc_1.SetSelectedRange(id_start, id_end)

ib_ed = True

IF id_start > id_end THEN

ld_temp = id_start

id_start = id_end

id_end = ld_temp

SetNull(ld_temp)

END IF

st_start.text = String(id_start)

st_end.text = string(id_end)



ELSEIF ib_st = true and ib_ed = true THEN

li_return = mc_1.ClearBoldDates()

ib_st = False

ib_ed = False

li_return = mc_1.GetSelectedDate ( id_start )

ib_st = True

END IF



Please advise what going wrong ?
  1. Helpful
  1. John Fauss
  2. Thursday, 15 August 2024 13:31 PM UTC
As I stated in my reply, I've never used this control, so I'm unable to advise you further. Perhaps other Community members can offer some assistance?

Some questions/suggestions I do have for you to consider are: (1) Provide some details regarding the actual begin/end dates you are testing so that others can replicate the conditions. (2) Perhaps you could also provide a more detailed description of the behavior that more clearly explain the phrase "it becomes crazy" -- what does that mean? (3) It ALWAYS helps everyone to know the version, release and build of PowerBuilder that you are using up front, so please provide this information whenever you ask a question.
  1. Helpful 1
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.