FAQ Database Discussion Community


datepicker yii2 kartik wrong format

yii2,datetimepicker
I have a problem with the kartik datetime picker. The value that has to be entered gets scrambled in the input, following screenshot probably tells it all: I simply followed the demo code: <?php use kartik\datetime\DateTimePicker; echo '<label>Start Date/Time</label>'; echo DateTimePicker::widget([ 'name' => 'startdatetime', 'options' => ['placeholder' => 'Select operating...

c# loop and get the values of all datetimepicker in form programmatically

c#,winforms,loops,datetimepicker,value
I have a form with multiple TextBox and NumericUpDown And DateTimePicker. I want to get programmatically all value of this controls and insert them to sql server data base I tried this code foreach (Control contrl in this.Controls) { if (contrl.Name != "") { vv.Add(contrl.Text); //MessageBox.Show(contrl.Name); } } it gets...

Bootstrap date-time picker asp.NET MVC

jquery,css,asp.net-mvc,date-format,datetimepicker
I am using this function <script src="~/Scripts/jquery.datetimepicker.js"></script> <script type="text/javascript"> $(function () { $('.datetimepicker').datetimepicker({}); }); </script> And this code to show the datetime: @Html.EditorFor(model => model.SomeNameDateTimeFormat, new { htmlAttributes = new { @class = "form-control input-sm datetimepicker"} }) However, css is not working at all, it renders calendar on the side...

Custom format for entire application

c#,winforms,datetimepicker,custom-formatting
How to set/enforce common format for entire application? For grids and controls like dateTimePicker just to not worry about it while developing? I tried to set in my own wrapper on controls but every time I run the designer this value is overwritten. I'm afraid that when I want to...

datetimepicker. widget doesn't show

javascript,jquery,twitter-bootstrap,datetimepicker
I am trying to repeat example from datepicker documenation on jsfiddle tutorial I have wrote the following html code: <div class="container"> <div class="row"> <div class='col-sm-6'> <div class="form-group"> <div class='input-group date' id='datetimepicker1'> <input type='text' class="form-control" /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> </div> </div> </div> </div> and following js: $(function...

new Date returned NA value in using datetimepicker

javascript,jquery,date,datetime,datetimepicker
DEMO http://jsfiddle.net/2jp7opow/ I want to store like date like this to the DB : yyyy/mm/dd H:mm AM/PM but currently my format is dd/mm/yyyy.. I try to convert it via parsing, it worked strangely. When u select days that is after 12, it return NANANANANA.. why? $(function () { $('input').datetimepicker({ formatTime:...

How to check selected value of datetime picker to be in some value range?

c#,datetime,datetimepicker
I want to select a date from a date time to be in a specific time range. I want to select a user's birthday in my datetime picker. I want to add only the users of age between 18-100 years. I want to check whether selected value of my datetime...

Align the Bootstrap Datetimepicker so that it rests above the textbox instead of below

jquery,html,css,twitter-bootstrap,datetimepicker
How do you align the Bootstrap Datetimepicker so that it rests above the textbox instead of below. My popup window is currently being cut out by another div. Code $(document).ready(function () { $('#datetime').datetimepicker({ locale: 'en' }); }); <input type="text" class="form-control booking" id="datetime" placeholder="I want it now"> Fiddle here...

If condition with datetimepicker & datagridview cell date

c#,if-statement,datagridview,datetimepicker
I'm new to C# programming & i have lack of knowledge in coding. So please help me out here. I have datagridview(hereafter dgv) without bind to any datasource. dgv is feeding data from some text boxes & datetimepicker(hereafter dtp) on the form. I want to check an if condition before...

Bootstrap datetimepicker don't work with readonly or disabled

javascript,jquery,html,twitter-bootstrap-3,datetimepicker
I have a serious problem with bootstrap datetimepicker, Here is the jsfiddle : <br/> <!-- padding for jsfiddle --> <div class="row"> <div class="col-md-12"> <h6>datetimepicker1</h6> <div class="form-group"> <div class="input-group date" id="datetimepicker1"> <input type="text" class="form-control" > <span class="input-group-addon"><span class="glyphicon-calendar glyphicon"></span></span> </div> </div> </div> </div> The problem is that when i...

DateTimePicker how to trigger onChangeTime() from outside the constructor

javascript,jquery,datetimepicker
I created a DateTimePicker and am currently using the "onChangeDateTime" as a means of updating a page using ajax. But I'm not a front end person and I'm having trouble understanding what exactly is going on and I have almost no experience with Jquery. I'm working on learning more but...

Model is not updating after select a date

angularjs,datetimepicker,mobile-angular-ui
The following code work with pure angularjs correct, but when I integrate it to a Mobile Angular UI App it does not update the model after selecting a date. If I edit the input field without the date picker it works fine. Template: <div> <label>{{myLabel}}:</label> <input class="form-control datetime-picker" placeholder="{{myPlaceholder}}" ng-model="ngModel"...

Android DatePickerDialog - hide past dates

java,android,datetimepicker
I want to hide past dates in DatePickerDialog in Fragment. For this am using: datePickerDialog.getDatePicker().setMinDate(System.currentTimeMillis() - 1000); but its showing me error ...cannot resolve this method "getDatePicker" in Fragment Any idea ??? THnx in advance public void showDatePicker() { datePickerDialog = DatePickerDialog.newInstance( this, dateTime.get(Calendar.YEAR), dateTime.get(Calendar.MONTH), dateTime.get(Calendar.DAY_OF_MONTH)); datePickerDialog.setYearRange(dateTime.get(Calendar.YEAR), dateTime.get(Calendar.YEAR) + 1);...

Minutes formatting issue in Query date time picker

jquery,date,jquery-plugins,datetimepicker,datetime-format
I am new to jQuery but I have been programming for more than two years in C#. I am developing a MVC project, there I have implemented a jQuery date time picker that would be used for get the user input for start date. I thought that I created the...

Change DateTimePicker style on combobox selection fails

c++,c,winapi,combobox,datetimepicker
I am trying to change the style and date format of the DateTimePicker control on combobox' CBS_SELCHANGE notification. When user selects one option, datetime picker should have spin control and show only year. If user selects other options, style should be reset to short date style and date format should...

Date-Time-Range directive field is not showing any values

javascript,angularjs,twitter-bootstrap,datetimepicker,angular-directive
I have created an Date Time Range Directive in AngularJS. I am using dangrossman/bootstrap-daterangepicker plugin for getting the Date Time Range Calendar. The directive is working fine as well as the model value is getting changed but the view is not updating. element.data('daterangepicker').setStartDate(val.start); element.data('daterangepicker').setEndDate(val.end); Can anyone please tell me some...

Datetime picker validation start date should be less than end date not working

jquery,datetimepicker
Jquery Date time picker validation start date should be less than end date, and my current code is not working $(document).ready(function(){ $("#startdate").datetimepicker({ format:'Y-m-d H:i:s', onSelect: function (selected) { var dt = new Date(selected); dt.setDate(dt.getDate() + 1); $("#enddate").datetimepicker("option", "minDate", dt); } }); $("#enddate").datetimepicker({ format:'Y-m-d H:i:s', onSelect: function (selected) { var...

Datetimepicker comparing two dates/times

jquery,html,datetimepicker
I've looked through several posts, and tried several options to no avail can I compare two dates that include time from datetimepicker. This is the jquery datetimepicker located here: https://plugins.jquery.com/datetimepicker/ I have two times in a form like so: <tr> <td colspan="2"> <label for="">Start Time</label> <input id="datetimepicker" class="form-control" type="text" placeholder="Click...

Adding 7 days to date in xdsoft datetimepicker

jquery,datetimepicker
I'm using XD Soft DateTimePicker for displaying datepicker. I have two text-boxes "txtFromDate" and "txtToDate" What I need? When I select a date in "txtFromDate" then the "txtToDate" can only select the next 7 days. ie. max date in "txtToDate" will be +7 days of selected days in "txtFromDate" What...

Date format changing after reload page in rails 4 using datetimepicker

jquery,ruby-on-rails,date,ruby-on-rails-4,datetimepicker
I've noticed something strange in my app. When I enter to the main page here: http://leszczyna.wzks.uj.edu.pl/12_stolarski/events_for_seniors/ and click on the second field in search and pick something, the date format appearing is 'dd-mm-yyyy'. But when I click in the top left-hand corner 'Wydarzenia dla seniorów' date format is changing to...

why do scripts reference on rendered partialview doesn't work, i used ajax to render a partial view, my datetimepicker wont work

jquery,ajax,asp.net-mvc-4,datetimepicker
i have this action on my controller public ActionResult Absent() { Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1)); Response.Cache.SetNoStore(); return PartialView(); } i have this javascript to call the above view. $('li.special > a').on('click', function (e) { e.preventDefault(); $('#loading-min').show(); $.ajax({ url: $(this).attr('href'), type: 'GET', success: function (result) { $('#loading-min').hide(); document.getElementById('row-report').innerHTML = result; } }); });...

How to set the default value in datetimepicker as previous month

vb.net,datetime,datetimepicker,datetime-format
I have my VB.net program with a datetimepicker and the custom format of which is MM/yyyy. I want the default value at application startup in the datetimepicker as previous month and I don't care whatever day it shows(it can be any day of previous month of the same year). Using...

DateTimePicker manipulation

c#,winforms,datetimepicker,adddays
I am trying to manipulate the value of the datetimepicker with a textchange event.. private void txtStay_TextChanged(object sender, EventArgs e) { dateTimePicker2.Text = dateTimePicker2.Value.AddDays(Convert.ToInt32(txtStay.Text)).ToString(); } but I'm having trouble when i press the backspace to change the value in the textbox, it causing an error. what i want to happen...

How to clear a data bound date time picker?

c#,winforms,datetimepicker,clear
I'm binding date to a date time picker control like this on windows form. dtpDOB.Value = Convert.ToDateTime(reader[4]); And when I want to clear it I'm using this code under a button click event. This is how I do that. dtpDOB.Format = DateTimePickerFormat.Custom; dtpDOB.CustomFormat = ""; dtpDOB.Checked = false; But it...

Set date time picker from a string (date and time)

c#,datetimepicker
I have a datetime picker. I want to read the data from a string which looks like this: 27/11/2014 17:35:59 what is the best way to set the value of the datetime picker? A code example will be appreciated....

Using Telerik MVC grid, editing row blanks TimePicker and DateTimePicker

.net,datetimepicker,telerik-grid,telerik-mvc
I have a Telerik grid populated by an Ajax command similar to the following: PowerStatusGrid.cshtml @{Html.Telerik().Grid(Model) .Name("PowerStatusGrid") .DataKeys(k => k.Add(o => o.StatusItemId)) .Columns(columns => { columns.Bound(o => o.ItemName).Title("Name").Width(250).ReadOnly(true); columns.Bound(o => o.DateTimePicker).Title("Date/Time").Width(150); columns.Command(commands => { commands.Edit().ButtonType(GridButtonType.BareImage).HtmlAttributes(new { @class = "grid-edit-button" }).ImageHtmlAttributes(new {...

Pass DateTimePicker Value to a stored procedure

c#,winforms,datetimepicker
I have two DateTimePicker on my form dtp_VacationStart and dtp_VacationEnd . I'd like to pass its value to a stored procedure My SQL Code CREATE PROC [ADD_VACATION] @vacationStart date ,@vacationEnd date ,@vacationMem nvarchar (100) = NULL ,@idVacationKind_L int ,@idMember_L int AS INSERT INTO [tblVacation] ([vacationStart] ,[vacationEnd] ,[vacationMem] ,[idVacationKind_L] ,[idMember_L]) VALUES...

Proper format for user input of time for timespan conversion VB

vb.net,variables,datetime,datetimepicker,timespan
I am currently using combo boxes for the user to input specified times to be stored into DateTime variables. These DateTime variables will then be added or subtracted respectively to obtain a TimeSpan variable. The combo box text if formatted like this: 12:00:00 AM 01:00:00 AM 02:00:00 AM 03:00:00 AM...

How to find today's date in DateTimePicker JavaScript?

javascript,jquery,datetimepicker
I'm using the following javascript: http://xdsoft.net/jqplugins/datetimepicker , and I want to achieve simple effect - when User selects today's day, it should show him only hours available from now until the end of the day, the previous time should be disabled. But when he choses any other day in the...

Using multiple instances of datetimepicker working with a Range between date

javascript,jquery,datetimepicker
I'm trying to get the "Range between date" work for multiple instances. Each instance couple has a different id. The datetimepicker is added using the class, which is the same for all instances: var format = "d-m-Y H:i"; var startSelector = ".date_timepicker_start"; var endSelector = ".date_timepicker_end"; Now I want to...

set max date dynamicaly in jquery

jquery,datetimepicker
I am try to implementing datepicker using jquery ,I want set max date of second datepicker is to selected date of first datepicker. here is my code :- $('#firstDatePiker').datetimepicker({ dayOfWeekStart : 1, lang:'en', startDate:""+currentdate, minDate: 0 }); $('#proofingDate').datetimepicker({ dayOfWeekStart : 1, lang:'en', startDate:""+currentdate, minDate: 0, }); I have call function...

Jquery Time Picker inside ng-repeat is not working

jquery,angularjs,angularjs-directive,angularjs-ng-repeat,datetimepicker
As i am proceeding into my project. In Some place i need to repeat few input fields which contains two time html5 field. Everything was going well when i was testing in Chrome but when i tested in in firefox it is showing as text field. (Firefox does not support...

Date from textbox to datetimepicker

c#,winforms,datetimepicker
I have a form with DateTimePicker and TextBox and want the DateTimePicker to get its value from TextBox i tried DateTimePicker.Value = Convert.ToDateTime(TextBox.Text); but it didn't work any help please ? thanks...

Select months between two dates

c#,excel,datetimepicker
I am trying to create a form which will take attendance data from a database and transfer to a excel sheet to print out. I have created the form and with two datetimepickers I have managed to get the month to begin the travel claim and the month I want...

Angular Bootstrap DateTimePicker - Highlight Today Date on embedded Calender

angularjs,datetimepicker,momentjs,angular-bootstrap
Please accept my apologies if i had any mistakes in my post. This is my first post here. But, i am not new to StackOverflow. Correct me if any. I am using angular-bootstrap-datetimepicker library from the below url: Link to library I am currently embedding the calender on the page....

How to insert only time in ms access?

c#,ms-access,datetimepicker
This is the query I am having issues with: cmd = new OleDbCommand(insert into tbl_Customer(cReportingTime) values (@ReportingTime)", con); cmd.Parameters.Add("@ReportingTime", OleDbType.DBTime).Value = Time; cmd.ExecuteNonQuery(); When I try to run it I am getting this error: "Failed to convert parameter value from a DateTime to a TimeSpan" I want to insert only...

How to disable time in Bootstrap DateTimePicker?

javascript,jquery,twitter-bootstrap,twitter-bootstrap-3,datetimepicker
I wanna use bootstrap datetimepicker without select time but it is not working. I gave false value to the pickTime parameter but it is still not working. But Format and language parameters is working. Here is the code! How can i fix this? <script type="text/javascript"> $(function () { $('#datetimepicker1').datetimepicker({ format:...

Setting Minimum Date for Date Time Picker for Windows Forms C#

c#,winforms,datetimepicker,windows-forms-designer
I'm currently working on a To-Do list Windows Forms application in C# which features a date time Picker, through some research I was able to find that I am able to set the MinValue property of the date time picker within the Designer Tab of the form. The plan was...

NodaTime usage for datetimepicker

winforms,datetimepicker,c#-5.0,nodatime
To avoid label of duplicate here's a brief summary of all what i did. After spending hours of googling to calculate the difference between two dates I came across here and here where, i was convinced to use NodaTime to get difference in terms of years,months and days.My application needs...

Bootstrap 3 datetimepicker doesn't trigger after container is get by ajax

jquery,ajax,bootstrap,datetimepicker
I'm using bootstrap 3 datetimepicker component. I'm using construction: $('.datetimepickerbutton').datetimepicker({ format: 'DD.MM.YYYY' }); And it's working fine, until I will send content by ajax. Ajax form is inside .myDate div and it's targer id. How should I use jquery's "on" method to has my code working for ajax also? Im'...

Using a Jquery Function on multiple divs [duplicate]

javascript,jquery,html,datetimepicker
This question already has an answer here: putting datepicker() on dynamically created elements - JQuery/JQueryUI 3 answers I am working on a project, where at one point you have to add multiple dates. The Problem is that the Date & Time Pickers work on the first set of textboxes,...

Building a TimePickerDialog method

android,methods,datetimepicker
I got 4 EditText views with different variables for each of them. I want to call a TimePickerDialog when clicking on each one of the EditText views and pass the relevant parameters each time, so I was trying to build a method for this instead of writing the whole code...

Is there a way to clear value in a particular field after failed submission?

ruby-on-rails,ruby-on-rails-4,jquery-plugins,datetimepicker
I have separate date and time field: ie Start date , Start time, End date, End time. Im using jquery time picker, and date pair plugin. If I fill either one of start date or end date, they will both be filled in with values automatically. And same in Start...

jQuery datetimepicker destroy not working

jquery,twitter-bootstrap,datepicker,datetimepicker
I am trying to destroy a datetimepicker on change of another. Here is my scenario- I have two or more datetimepickers in my application. As an example if I change first datetimepicker then it's date is set to .next() datetimepicker as minimum setup of date, Hence for all next datetimepickers....

How to subtract dateTimePicker fields in C#

c#,winforms,datetimepicker
I have 2 dateTimePicker fields on my form. How can I subtract those fields? For example if I have field1 = Friday/May/1 and field2 = Sunday/May/3 I want to get subtract value in textBox field3 = field2 - field1 = 3 (friday, saturday, sunday)...