CalendarWidget

Peter M. Brigham, MD pmbrig at gmail.com
Wed Mar 28 10:28:04 EDT 2012


For instance, in your stack, or in your field script:

start using stack "calendarWidget100"
-- d = date, in dateitems format
put altAnswerDate(item 1 of d,item 2 of d,item 3 of d) into theDate
stop using stack "calendarWidget100"
if theDate = "" then exit to top
put item 2 of theDate & "/" & item 3 of theDate & "/" & char 3 to 4 \
                   of item 1 of theDate into theDate
put theDate into fld "myField"

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig


On Mar 27, 2012, at 11:53 AM, Bob Sneidar wrote:

> What I do is I put the dates I want to start with into the dialogData and then call the calendar stack as modal or as sheet (which is modal by nature). When I return from the calendar stack I get the dialogData, checking for empty in case the user cancelled. I let the calling stack handle what to do with the date. For instance, what if the user selected a date earlier than today, and your stack was scheduling a lodging reservation? That would clearly be an error. However you might be working with a to-do list in which case pre dating an event would be conceivable. The Calendar stack couldn't possibly know the difference, so I would not have the calendar stack populate anything if I were you. 
> 
> Bob
> 
> 
> On Mar 26, 2012, at 7:21 PM, Charles Szasz wrote:
> 
>> on mouseUp
>>  if dialogdata is not empty
>>  then
>>     put item 2 of dialogdata into t 
>>     put "/" after t
>>     put item 3 of dialogdata after t 
>>     put "/" after t
>>     put item 1 of dialogdata into s 
>>     delete character 1 to 2 of s 
>>     put s after t     
>>     put t into field "date1" of stack "My app"
>>  else
>>     put the uMonth of group "calendarWidget" of card id 1002 into t
>>     put "/" after t
>>     put the uMonth of group "calendarWidget" of card id 1002 after t 
>>     put "/" after t
>>     put the uYear of group "calendarWidget" of card id 1002 into s
>>     delete character 1 to 2 of s
>>     put s after t
>>     put t into field "date1" of stack "My app"
>>  end if
>>  close this stack
>> end mouseUp
>> 
>> What changes do I need to make so calendarWidget 101 can insert dates in other fields?
>> 
>> Charles Szasz
>> cszasz at mac.com
>> 
>> 
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list