andyhill Posted March 28, 2018 Share Posted March 28, 2018 Please show me how I can use a Mobile TimePicker (no date) - thanks. Link to comment Share on other sites More sharing options...
Sherzod Posted March 28, 2018 Share Posted March 28, 2018 Hi, Can you try this approach?: http://forums.unigui.com/index.php?/topic/5760-datetimepicker-for-sencha-touch/ Link to comment Share on other sites More sharing options...
andyhill Posted March 29, 2018 Author Share Posted March 29, 2018 Followed your directions HOWEVER I do not want Month / Day / Year, I only want Hours / Minutes Link to comment Share on other sites More sharing options...
pedrisco Posted March 29, 2018 Share Posted March 29, 2018 slotOrder: ['hour','minute'] Link to comment Share on other sites More sharing options...
andyhill Posted March 29, 2018 Author Share Posted March 29, 2018 Thanks, that got rid of Day / Month / Year tumblers leaving only the Hour / Minute tumblers BUT they have no Captions to advise user what they are ? Link to comment Share on other sites More sharing options...
Sherzod Posted March 29, 2018 Share Posted March 29, 2018 Thanks, that got rid of Day / Month / Year tumblers leaving only the Hour / Minute tumblers BUT they have no Captions to advise user what they are ? Try this: config.picker = Ext.create('Ext.ux.picker.DateTime', { useTitles: true, //<----------- Link to comment Share on other sites More sharing options...
andyhill Posted March 29, 2018 Author Share Posted March 29, 2018 Yes - thank you Link to comment Share on other sites More sharing options...
andyhill Posted March 30, 2018 Author Share Posted March 30, 2018 I have wrestled with this over and over. The Picker does not accept or return the time (only the date) even though when opened you can see and change the time visually - it is not stored ? READ TimeFrom (TUnimDatePicker) var d1: TDateTime; myYear1, MyMonth1, MyDay1, myHour1, myMin1, mySec1, myMilli1: Word; begin try d1:= TimeFrom.Date; DecodeDateTime(d1, myYear1, MyMonth1, MyDay1, myHour1, myMin1, mySec1, myMilli1); ... WRITE TimeFrom (TUnimDatePicker) DecodeDate(UniMainModule.tblCart.FieldByName('BookingDate').AsDateTime, myYear1, MyMonth1, MyDay1); DecodeTime(UniMainModule.tblCart.FieldByName('BookingFromTime').AsDateTime, myHour1, myMin1, mySec1, myMilli1); TimeFrom.Date:= EncodeDateTime(myYear1, MyMonth1, MyDay1, myHour1, myMin1, mySec1, myMilli1); Help required ASAP. Link to comment Share on other sites More sharing options...
Sherzod Posted March 30, 2018 Share Posted March 30, 2018 I have wrestled with this over and over. The Picker does not accept or return the time (only the date) even though when opened you can see and change the time visually - it is not stored ? READ TimeFrom (TUnimDatePicker) var d1: TDateTime; myYear1, MyMonth1, MyDay1, myHour1, myMin1, mySec1, myMilli1: Word; begin try d1:= TimeFrom.Date; DecodeDateTime(d1, myYear1, MyMonth1, MyDay1, myHour1, myMin1, mySec1, myMilli1); ... WRITE TimeFrom (TUnimDatePicker) DecodeDate(UniMainModule.tblCart.FieldByName('BookingDate').AsDateTime, myYear1, MyMonth1, MyDay1); DecodeTime(UniMainModule.tblCart.FieldByName('BookingFromTime').AsDateTime, myHour1, myMin1, mySec1, myMilli1); TimeFrom.Date:= EncodeDateTime(myYear1, MyMonth1, MyDay1, myHour1, myMin1, mySec1, myMilli1); Help required ASAP. http://forums.unigui.com/index.php?/topic/5760-datetimepicker-for-sencha-touch/&do=findComment&comment=41359 Link to comment Share on other sites More sharing options...
andyhill Posted March 30, 2018 Author Share Posted March 30, 2018 All code is in place as instructed. The Reading and Writing of the Time values always results in ZERO. Is it possible the Time Picker only works if the platform is 'mobile' making /m (Desktop Emulation) invalid ? Link to comment Share on other sites More sharing options...
andyhill Posted March 31, 2018 Author Share Posted March 31, 2018 I have proved that on both Desktop Emulation (/m) and Mobile (iOS) the Time Values are not persistent - that is the modified TDatePicker (that now handles time) has no way of receiving the Time Values from Delphi (set the time) as well as has no way to have it's Time Values read by Delphi ? Using an ajax event to catch when the Time changes does not allow one to program the time into the picker in the first place plus it is messy to catch the time change and store elsewhere when it really should have been bound to the DateTime object - not forgetting to mention what happens if they do not change the time. Please advise how to resolve ASAP as this is very urgent - thanks in advance. Link to comment Share on other sites More sharing options...
Sherzod Posted April 1, 2018 Share Posted April 1, 2018 Hi, Can you make a simple tetcase? Link to comment Share on other sites More sharing options...
andyhill Posted April 1, 2018 Author Share Posted April 1, 2018 My project is too big so I tried to quickly knock this up 64bit Desktop / Mobile (hybrid). Please copy the 2 JavaScript files into the EXE Directory. Debug and trace set DatePicker (no time is set) and read DatePicker (no time is read). Project1.zip Link to comment Share on other sites More sharing options...
Sherzod Posted April 1, 2018 Share Posted April 1, 2018 Which build are you using? Link to comment Share on other sites More sharing options...
andyhill Posted April 1, 2018 Author Share Posted April 1, 2018 The one you told me to use for Tokyo 10.2 uni-1.0.0.1423 unim-1.0.0.1423 touch-2.4.2 ext-4.2.5.1763 Link to comment Share on other sites More sharing options...
andyhill Posted April 1, 2018 Author Share Posted April 1, 2018 Here it is again, this time Mobile W32. Please copy the 2 JavaScript files into the EXE Directory. Project1.zip Link to comment Share on other sites More sharing options...
Sherzod Posted April 8, 2018 Share Posted April 8, 2018 Hi, Sorry for delay, At the moment, I think that you need to use a local variable to store the date and time Will this solution acceptable to you? Link to comment Share on other sites More sharing options...
andyhill Posted April 8, 2018 Author Share Posted April 8, 2018 Yes. I can live with a Local Variable that can be updated by the Picker's Change Event HOWEVER how do I pre-load the Picker's Time with the Local Variables original Time ? Please show me in code - thanks. Link to comment Share on other sites More sharing options...
Sherzod Posted April 9, 2018 Share Posted April 9, 2018 For example like this: 1. A global variable: dtPicker: TDateTime; 2. function beforeInit(sender, config) { config.picker = Ext.create ( 'Ext.ux.picker.DateTime', { useTitles: true, doneButton: true, cancelButton: true, minuteInterval: 30, slotOrder: ['year', 'month', 'day', 'hour', 'minute'], toolbar: { //items : datetimepickettoolbaritems } } ); Ext.Date.patterns={CustomFormat: "d/m/Y H:i"}; config.dateFormat=Ext.Date.patterns.CustomFormat; //<---------------- } 3. procedure TMainmForm.UnimFormShow(Sender: TObject); var Fmt: TFormatSettings; begin Fmt.ShortDateFormat:='dd/mm/yyyy'; Fmt.DateSeparator :='/'; Fmt.LongTimeFormat :='hh:mm'; Fmt.TimeSeparator :=':'; dtPicker := Now; UnimDatePicker1.JSInterface.JSCall('setValue', [FormatDateTime('', dtPicker, Fmt)]); end; 4. procedure TMainmForm.UnimDatePicker1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); var Fmt: TFormatSettings; begin if EventName = '_timeChange' then begin Fmt.ShortDateFormat:='dd/mm/yyyy'; Fmt.DateSeparator :='/'; Fmt.LongTimeFormat :='hh:mm'; Fmt.TimeSeparator :=':'; dtPicker := StrToDateTime(Params.Values['val'], Fmt); end; end; Link to comment Share on other sites More sharing options...
andyhill Posted April 9, 2018 Author Share Posted April 9, 2018 Thank You - will test Link to comment Share on other sites More sharing options...
andyhill Posted April 9, 2018 Author Share Posted April 9, 2018 Works as expected - Thank You Again. Link to comment Share on other sites More sharing options...
Recommended Posts