UIDatePicker appears disabled when setting time programmatically - cocoa-touch

I have a UIDatePicker set for UIDatePickerModeTime. I am using the following code to set the time in my datePicker:
[self.oTimePicker setDate:dateFromString(self.oStartTime.text, #"HH:mm")];
[self.oTimePicker reloadInputViews];
which works but then the datePicker appears gray in color (see image below; it appears the datePicker is disabled), and sets the time to 06:00, no matter what is selected. Here is an image of the results; notice that I have picked 1:30 PM, but the text box shows 06:00; in addition, no matter what I select, nothing changes (the time displays what I pick (here 1:30 PM), but the value in the datePicker remains at 14:00 (but doesn't show 14:00 verified with NSLog), no matter what I select. Any ideas of what could be causing this?

It looks like you are having a time-zone issue with UIDatePicker. That is why it is showing one time in a UIDatePicker and another in your label (Washington has -7 time difference). There are lot of questions and answers about this topic (one example: iphone UIDatePicker showing wrong date in Central Timezone).
Another problem you are having is that UIDatePicker becomes disabled. This issue can be caused if you are setting datePicker.minimumDate to current date and using UIDatePickerModeTime.

Related

Vue v-datetime-picker starts in not allowed minimum time

When I pass the minimum time (min parameter) for the date picker, 02:00 is the minimum for example, but it starts selecting the not allowed value 00:00, if the user clicks OK, it sets the wrong not allowed value.
If I change to an allowed time, 03:00 for example, then I can't click again at 00:00 (expected behavior).
The image shows how the time picker starts once you click it. Note that I passed '02:00' as the minimum time and it started at 00:00 and the user is allowed to click OK and set the wrong time.
PS: I am using the vuetify-datetime-picker library
You cannot use min for this, rather use the built in props in v-time-picker called allowed-hours.
If you want to block 00:00, 01:00 and 02:00, then set allowed-hours like this:
<v-time-picker
:allowed-hours="v => v > 2 && v <= 23"
format="24hr"
/>
More information can be found here.

MPV player time format HH:MM:SS or HH:MM:SS:mmm

does anybody know, if it is possible to set default displayed time format including milliseconds in mpv.conf ?
Now I need click on time to switch to millisecnds, because option ,,timems'' from manual https://mpv.io/manual/master/ doesn't work.
Thanks for help
Peter
from window:
click the LEFT timestamp
from command:
mpv .. --script-opts=osc-timems=yes ..
or add in lua-settings/osc.conf:
timems=yes
mpv --osd-fractions --osd-level=2
or add to config
To toggle show - hide with keyboard, append to to input.conf:
o cycle-values osd-level 2 1
#^-- or any other key
yes, add the line osd-fractions to mpv.config. this will show milliseconds in the OSD (which will appear in mpv's terminal display).
if you want to see milliseconds in the OSC (in the video window), also add the line osd-level=2 to mpv.conf. this will add a status message with the OSD time display (which is now in milliseconds) to the top of the window.
Or you can click the time display on the video each time you load a video.

Using a variable and a set value inside the convert.ToDateTime function

I have created a program using Visual Basic that when the user enters all values needed and a button clicked, the program links to outlook and sets a reminder with the information previously enterd. I have created a successful program in doing so however the time set for the reminder is 12:00 AM as I have used a Date time picker with a short date(no time).
My question is can I user "convert.ToDateTime(VariableForDate, 8:00 AM) with the second paramater being a set value
current code(Does not work)
tmpapp.Start = Convert.ToDateTime(sFollowUpDate, 8:00 AM)
tmpapp.End = Convert.ToDateTime(sFollowUpDate, 8:00 AM)
Thanks in advance for any and all help
If you only ever have to add hours to a date you can use the AddHours method:
tmpapp.start = Convert.ToDateTime(sFollowUpDate).AddHours(8)
If you need to add more complex times (hours, minutes and seconds) you can use:
tmpapp.start = Convert.ToDateTime(sFollowUpDate).Add(new TimeSpan(8,0,0))
The TimeSpan constructor I've used has arguments for hour, minute and second respectively.

Bootstrap DatePicker setDate method not updating calendar

I'm setting the value of a bootstrap datepicker by making use of the setValue method provided.
For example
tripToDatePicker.setValue(tripFromDatePicker.date);
But for some reason the calendar is not updated
'setValue' is replaced by 'setDate'.
Using a string as input for setDate can be tricky. It has to match with the dateformat, else you can get unexpected results. It is more safe to create a 'new Date(y,m,d)' from your input, e.g. new Date(2015,3,10) for '10 Apr 2015'. This will always work.
When using a date representation in seconds, e.g. 1428659901, then use 'new Date(value*1000)'. Note that datepicker will eat any value here, but only show the selected date in the calendar if hours, minutes and seconds are equal to 0. Took me a while to figure that out....
Edit:
http://www.eyecon.ro/bootstrap-datepicker/ is not much documented, you should try http://eternicode.github.io/bootstrap-datepicker/.
anyway the code below will work for you
$("#dp1").datepicker("update", "02-16-2012");
or
$("#dp1").datepicker("setValue", "02-17-2012");
where "#dpi" is the id of the text field on whcih datepicker is used.
After trying many things, I ended up using "update" method. The $("#dp1").datepicker("update", "02-02-2012") or $("#dp1").datepicker("update", "02/02/2012") works for me. Surprisingly no document about this method at author website. Thanks.

Bootstrap 3 - DateTimePicker - Can time portion be ignored?

I'm using the Bootstrap 3 DateTimePicker. When the user tabs into a field using this component, the current date and time is automatically entered. In some cases this is what I want. However, there are other times I want the component to completely ignore the time portion and not entered by default in a field. I can't seem to find a way to do this.
This will only display the date by default, try and see
$('.future');.datetimepicker({
pickTime: false,
format: 'DD/MM/YYYY'
});