Search Results

Search found 61 results on 3 pages for 'mindate'.

Page 1/3 | 1 2 3  | Next Page >

  • Jquery datepicker mindate, maxdate

    - by Cesar Lopez
    I have the two following datepicker objects: This is to restrict the dates to future dates. What I want: restrict the dates from current date to 30 years time. What I get: restrict the dates from current date to 10 years time. $(".datepickerFuture").datepicker({ showOn: "button", buttonImage: 'calendar.gif', buttonText: 'Click to select a date', duration:"fast", changeMonth: true, changeYear: true, dateFormat: 'dd/mm/yy', constrainInput: true, minDate: 0, maxDate: '+30Y', buttonImageOnly: true }); This is to restrict to select only past dates: What I want: restrict the dates from current date to 120 years ago time. What I get: restrict the dates from current date to 120 years ago time, but when I select a year the maximum year will reset to selected year (e.g. what i would get when page load from fresh is 1890-2010, but if I select 2000 the year select box reset to 1880-2000) . $(".datepickerPast").datepicker({ showOn: "button", buttonImage: 'calendar.gif', buttonText: 'Click to select a date', duration:"fast", changeMonth: true, changeYear: true, dateFormat: 'dd/mm/yy', constrainInput: true, yearRange: '-120:0', maxDate: 0, buttonImageOnly: true }); I need help with both datepicker object, any help would be very much appreciated. Thanks in advance. Cesar.

    Read the article

  • How can I set the minDate/maxDate for jQueryUI Datepicker using a string?

    - by leo
    jQueryUI Datepicker documentation states that the minDate option can be set using "a string in the current dateFormat". So I've tried the following to initialize datepickers: $("input.date").datepicker({ minDate: "01/01/2010", maxDate: "12/31/2010" }); However, this results in my datepicker having a selectable date range that goes from 11/06/2015 to 12/17/2015. I've checked the current dateformat and its mm/dd/yy, which is supposed to mean 2 digits for the month, 2 for the day, and 4 for the year, separated by slashes. I've also tried including dateFormat: "mm/dd/yy" in the inizialization statement. I've also checked the values for minDate and maxDate afterwards and they ARE being set to the values I want: 01/01/2010 and 12/31/2010. I want to be able to set min/maxDate with strings because I'm being passed these values as strings from somewhere else. Maybe someone knows why this happens and how to solve this, or a workaround to achieve this, perphaps changing the format of the date strings or something? Thanks EDIT: Using: jQuery v1.3.2 and jQuery UI v1.7.2

    Read the article

  • Changing minDate option in JQuery DatePicker does nothing

    - by futureelite7
    I have this jQuery datepicker code that initially set the minDate of the datepicker. After a user selects a starting date, I used the option attribute to change the minDate of the datepicker, but nothing happens. What did I do wrong and how should I make it work? Datepicker init code: $(function () { $('#starttime,#endtime,#validity').datepicker({ numberOfMonths: [1, 2], buttonImageOnly: true, showAnim: 'slideDown', buttonImage: '../images/cal.gif', beforeShow: customRange, dateFormat: "dd-mm-yy", firstDay: 1, changeFirstDay: false }); }); Datepicker change minimum date code: var startdate = new Date(2010,4-1, 4-1,0,0,0); $("#endtime").datepicker('option','minDate',startdate);

    Read the article

  • jQuery datepicker minDate variable

    - by d3020
    I'm usung the jQuery datepicker. In my "EndDate" textbox I'd like to use the date selected from the the "StartDate" textbox + 1. How do I do this? I tried this but didn't work. In my start date code I had... test = $(this).datepicker('getDate'); testm = new Date(test.getTime()); testm.setDate(testm.getDate() + 1); Then in my end date code I had... minDate: testm, but the end date still made all the days for the month available. Thanks. Edit. I'm curious as to why this doesn't work. In my start date datepicker I have this.. onSelect: function (dateText, inst) test = dateText Why can't I come down into my end date datepicker and say, minDate: test?

    Read the article

  • setting minDate in datepicker in Rails

    - by Sakshi Jain
    I need to apply minDate attribute to the datepicker in Rails App. In _admin_controls.html.erb <%= f.input :end_date, wrapper: :append do %> <div id="datepicker" class="datepicker input-group edit-left"> <%= f.text_field :end_date, :class => "datetime form-control" %> application.js contains jQuery(document).on('focus', 'input.datetime', function() { opts = {format: 'M dd, yyyy', autoclose: true}; jQuery(this).datepicker(opts); jQuery(".datepicker").css("z-index",10000); }); What should be the javascript to do so only for _admin_controls.html.erb?

    Read the article

  • mocking collection behavior with Moq

    - by Stephen Patten
    Hello, I've read through some of the discussions on the Moq user group and have failed to find an example and have been so far unable to find the scenario that I have. Here is my question and code: // 6 periods var schedule = new List<PaymentPlanPeriod>() { new PaymentPlanPeriod(1000m, args.MinDate.ToString()), new PaymentPlanPeriod(1000m, args.MinDate.Value.AddMonths(1).ToString()), new PaymentPlanPeriod(1000m, args.MinDate.Value.AddMonths(2).ToString()), new PaymentPlanPeriod(1000m, args.MinDate.Value.AddMonths(3).ToString()), new PaymentPlanPeriod(1000m, args.MinDate.Value.AddMonths(4).ToString()), new PaymentPlanPeriod(1000m, args.MinDate.Value.AddMonths(5).ToString()) }; // Now the proxy is correct with the schedule helper.Setup(h => h.GetPlanPeriods(It.IsAny<String>(), schedule)); Then in my tests I use Periods but the Mocked _PaymentPlanHelper never populates the collection, see below for usage: public IEnumerable<PaymentPlanPeriod> Periods { get { if (CanCalculateExpression()) _PaymentPlanHelper.GetPlanPeriods(this.ToString(), _PaymentSchedule); return _PaymentSchedule; } } Now if I change the mocked object to use another overloaded method of GetPlanPeriods that returns a List like so : var schedule = new List<PaymentPlanPeriod>() { new PaymentPlanPeriod(1000m, args.MinDate.ToString()), new PaymentPlanPeriod(1000m, args.MinDate.Value.AddMonths(1).ToString()), new PaymentPlanPeriod(1000m, args.MinDate.Value.AddMonths(2).ToString()), new PaymentPlanPeriod(1000m, args.MinDate.Value.AddMonths(3).ToString()), new PaymentPlanPeriod(1000m, args.MinDate.Value.AddMonths(4).ToString()), new PaymentPlanPeriod(1000m, args.MinDate.Value.AddMonths(5).ToString()) }; helper.Setup(h => h.GetPlanPeriods(It.IsAny<String>())).Returns(new List<PaymentPlanPeriod>(schedule)); List<PaymentPlanPeriod> result = new _PaymentPlanHelper.GetPlanPeriods(this.ToString()); This works as expected. Any pointers would be awesome, as long as you don't bash my architecture... :) Thank you, Stephen

    Read the article

  • jQuery datepicker getMinDate '+1d'

    - by Adrian Adkison
    Once I have set the minDate property of a datepicker with the convenient string syntax $(elem).datepicker('option','minDate','+1d +3m'); how can I get the date object of the minDate? To help illustrate, there is a method $(elem).datepicker('getDate'); which returns the date that is entered in the input in the format of a date object. I would like the same thing but for datepicker('getMinDate'). There is an option like this $(elem).datepicker('option','minDate'); but this returns '+1d +3m' which is not helpful. I need the actual date object to compare with another date object. Any ideas?

    Read the article

  • Is there a way to delay compilation of a stored procedure's execution plan?

    - by Ian Henry
    (At first glance this may look like a duplicate of http://stackoverflow.com/questions/421275 or http://stackoverflow.com/questions/414336, but my actual question is a bit different) Alright, this one's had me stumped for a few hours. My example here is ridiculously abstracted, so I doubt it will be possible to recreate locally, but it provides context for my question (Also, I'm running SQL Server 2005). I have a stored procedure with basically two steps, constructing a temp table, populating it with very few rows, and then querying a very large table joining against that temp table. It has multiple parameters, but the most relevant is a datetime "@MinDate." Essentially: create table #smallTable (ID int) insert into #smallTable select (a very small number of rows from some other table) select * from aGiantTable inner join #smallTable on #smallTable.ID = aGiantTable.ID inner join anotherTable on anotherTable.GiantID = aGiantTable.ID where aGiantTable.SomeDateField > @MinDate If I just execute this as a normal query, by declaring @MinDate as a local variable and running that, it produces an optimal execution plan that executes very quickly (first joins on #smallTable and then only considers a very small subset of rows from aGiantTable while doing other operations). It seems to realize that #smallTable is tiny, so it would be efficient to start with it. This is good. However, if I make that a stored procedure with @MinDate as a parameter, it produces a completely inefficient execution plan. (I am recompiling it each time, so it's not a bad cached plan...at least, I sure hope it's not) But here's where it gets weird. If I change the proc to the following: declare @LocalMinDate datetime set @LocalMinDate = @MinDate --where @MinDate is still a parameter create table #smallTable (ID int) insert into #smallTable select (a very small number of rows from some other table) select * from aGiantTable inner join #smallTable on #smallTable.ID = aGiantTable.ID inner join anotherTable on anotherTable.GiantID = aGiantTable.ID where aGiantTable.SomeDateField > @LocalMinDate Then it gives me the efficient plan! So my theory is this: when executing as a plain query (not as a stored procedure), it waits to construct the execution plan for the expensive query until the last minute, so the query optimizer knows that #smallTable is small and uses that information to give the efficient plan. But when executing as a stored procedure, it creates the entire execution plan at once, thus it can't use this bit of information to optimize the plan. But why does using the locally declared variables change this? Why does that delay the creation of the execution plan? Is that actually what's happening? If so, is there a way to force delayed compilation (if that indeed is what's going on here) even when not using local variables in this way? More generally, does anyone have sources on when the execution plan is created for each step of a stored procedure? Googling hasn't provided any helpful information, but I don't think I'm looking for the right thing. Or is my theory just completely unfounded? Edit: Since posting, I've learned of parameter sniffing, and I assume this is what's causing the execution plan to compile prematurely (unless stored procedures indeed compile all at once), so my question remains -- can you force the delay? Or disable the sniffing entirely? The question is academic, since I can force a more efficient plan by replacing the select * from aGiantTable with select * from (select * from aGiantTable where ID in (select ID from #smallTable)) as aGiantTable Or just sucking it up and masking the parameters, but still, this inconsistency has me pretty curious.

    Read the article

  • What jquery code or plugin would I use to update the position of an element?

    - by Breadtruck
    I am using a jquery plugin from [ FilamentGroup ] called DateRangePicker. I have a simple form with two text inputs for the start and end date that I bind the DateRangePicker to using this $('input.tbDate').daterangepicker({ dateFormat: 'mm/dd/yy', earliestDate: new Date(minDate), latestDate: new Date(maxDate), datepickerOptions: { changeMonth: true, changeYear: true, minDate: new Date(minDate), maxDate: new Date(maxDate) } }); I have a collapsible table above this form that when shown, moves the form and the elements that the daterangepicker plugin is bound to, down lower on the page, but the daterangepicker appears to keep the position from when it was actually created. What code could I put in the daterangepicker's onShow Callback to update its position to be next to the element is was initially bound to? Or is there some specific jquery method or plugin that I could chain to the daterangepicker plugin so that it will update its position correctly. This would come in handy for some other plugins that I use that don't seem to keep their position relative to other elements correctly either.

    Read the article

  • Change value of jquery variable based on a select box

    - by Nikos
    I have a jquery datepicker script and what I want to do is to change "minDate: 10" value by a select box. $(function() { $('#hotel').change(function() { // assign the value to a variable, so you can test to see if it is working var selectVal = $('#hotel :selected').val(); if( selectVal == "hotel_c" ) { var date = 10; } if( selectVal == "hotel_a" ) { var date = 15; } if( selectVal == "hotel_b" ) { var date = 6; } }); var dates = $('#from, #to').datepicker({ defaultDate: "+1w", changeMonth: true, dateFormat: 'yy-m-d', minDate: 10, numberOfMonths: 3, onSelect: function(selectedDate) { var option = this.id == "from" ? "minDate" : "maxDate"; var instance = $(this).data("datepicker"); var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings); dates.not(this).datepicker("option", option, date); } }); });

    Read the article

  • What jquery code or plugin would I use to update the position of an element created by a plugin

    - by Breadtruck
    I am using a jquery plugin from [ FilamentGroup ] called DateRangePicker. I have a simple form with two text inputs for the start and end date that I bind the DateRangePicker to using this $('input.tbDate').daterangepicker({ dateFormat: 'mm/dd/yy', earliestDate: new Date(minDate), latestDate: new Date(maxDate), datepickerOptions: { changeMonth: true, changeYear: true, minDate: new Date(minDate), maxDate: new Date(maxDate) } }); I have a collapsible table above this form that when shown, moves the form and the elements that the daterangepicker plugin is bound to, down lower on the page, but the daterangepicker appears to keep the position from when it was actually created. What code could I put in the daterangepicker's onShow Callback to update its position to be next to the element is was initially bound to? Or is there some specific jquery method or plugin that I could chain to the daterangepicker plugin so that it will update its position correctly. This would come in handy for some other plugins that I use that don't seem to keep their position relative to other elements correctly either.

    Read the article

  • Convert a Date to a String in Sqlite

    - by Billy
    Is there a way to convert a date to a string in Sqlite? For example I am trying to get the min date in Sqlite: SELECT MIN(StartDate) AS MinDate FROM TableName I know in SQL Server I would use the SQL below to accomplish what I am trying to do: SELECT CONVERT(VARCHAR(10), MIN(StartDate), 101) AS MinDate FROM TableName Thanks!

    Read the article

  • Combining 2 jquery scripts to work together

    - by Nikos
    I have these 2 scripts and the problem is that function check is called only if #hotel state is changed. How can I make function check run and in the case of #hotel doesn't change. var hotelMap = { hotel_a: 15, hotel_b: 5, hotel_c: 10 }; $(function() { $('#hotel').change(function() { var selectVal = $('#hotel :selected').val(); $("#from, #to").datepicker("option", "minDate", hotelMap[selectVal]); }); var dates = $('#from, #to').datepicker({ defaultDate: "+1w", changeMonth: true, dateFormat: 'yy-m-d', minDate: 10, numberOfMonths: 3, onSelect: function(selectedDate) { var option = this.id == "from" ? "minDate" : "maxDate"; var instance = $(this).data("datepicker"); var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings); dates.not(this).datepicker("option", option, date); } }); }); $(document).ready(check); function check(){ $('#from, #to, #hotel').bind('change', update); $('#wait').show(); } function update(){ var from=$('#from').attr('value'); var to=$('#to').attr('value'); var hotel=$('#hotel').attr('value'); $.get('get_availability.php', {from: from, to:to, hotel:hotel}, show); } function show(avail){ $('#wait').hide(); $('#availability').html(avail); }

    Read the article

  • How to avoid overlapping date ranges when using a grouping clause?

    - by k rey
    I have a situation where I need to find time spans between value changes. I tried a simple group by clause but it eliminates overlapping changes. Consider the following example: create table #items ( code varchar(4) , class varchar(4) , txdate datetime ) insert into #items (code, class, txdate) values ('A', 'C', '2010-01-01'); insert into #items (code, class, txdate) values ('A', 'C', '2010-01-02'); insert into #items (code, class, txdate) values ('A', 'C', '2010-01-03'); insert into #items (code, class, txdate) values ('A', 'D', '2010-01-04'); insert into #items (code, class, txdate) values ('A', 'D', '2010-01-05'); insert into #items (code, class, txdate) values ('A', 'C', '2010-01-06'); insert into #items (code, class, txdate) values ('A', 'C', '2010-01-07'); insert into #items (code, class, txdate) values ('A', 'D', '2010-01-08'); insert into #items (code, class, txdate) values ('A', 'D', '2010-01-09'); select code , class , min(txdate) mindate , max(txdate) maxdate from #items group by code, class This returns the following results (notice the overlapping date ranges): |code|class|mindate |maxdate | ---------------------------------- |A |C |2010-01-01|2010-01-07| |A |D |2010-01-04|2010-01-09| I would like to have the query return the following: |code|class|mindate |maxdate | ---------------------------------- |A |C |2010-01-01|2010-01-03| |A |D |2010-01-04|2010-01-05| |A |C |2010-01-06|2010-01-07| |A |D |2010-01-08|2010-01-09| Any ideas and suggestions?

    Read the article

  • jQuery Datepicker - Programatically Limit Second Datepicker

    - by Dodinas
    Hello all, I've recently been using the following piece of code to limit my 2nd Date picker (end date) so that it does not precede the date of the 1st Date picker. $("#datepicker").datepicker({ minDate: +5, maxDate: '+1M +10D', onSelect: function(dateText, inst){ var the_date = dateText; $("#datepicker2").datepicker('option', 'minDate', the_date); } }); $("#datepicker2").datepicker({ maxDate: '+1M +10D', onSelect: function(dateText, inst){ } }); However, lately, I wanted to format my datepickers using: dateFormat: 'yy-mm-dd' But now, the 2nd datepicker actually allows the user to pick a date 1 day before. For example, if the user picks the 1st date: 2010-04-03, when the 2nd Datepicker pops up, they are able to pick 2010-04-02 (1 day before their first selected date). I do not want the user to be able to pick a date that was before their first selected day. Any ideas why this isn't working after I added in the "dateFormat"?

    Read the article

  • RadControl DateTimePicker Selecting new time doesn't remove highlight from previous selection

    - by Jason Beck
    This is not browser specific - the behavior exists in Firefox and IE. The RadControl is being used within a User Control in a SiteFinity site. Very little customization has been done to the control. <telerik:RadDateTimePicker ID="RadDateTimePicker1" runat="server" MinDate="2010/1/1" Width="250px"> <ClientEvents></ClientEvents> <TimeView starttime="08:00:00" endtime="20:00:00" interval="02:00:00"></TimeView> <DateInput runat="server" ID="DateInput"></DateInput> </telerik:RadDateTimePicker> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { RadDateTimePicker1.MinDate = DateTime.Now; } }

    Read the article

  • jquery datepicker: select date as back as 6 months

    - by Abu Hamzah
    Start date: user can select start date as back as 6 months. example: if today is 04/23/2010 then i can go back up to 11/23/2009 but not more than 6 months. <script type="text/javascript"> $(document).ready(function () { $('#endDate').datepicker({ showOn: 'button', buttonImage: '../images/Calendar.png', buttonImageOnly: true, onSelect: function () { }, onClose: function () { $(this).focus(); } }); $('#startDate').datepicker({ showOn: 'button', buttonImage: '../images/Calendar.png', buttonImageOnly: true, onSelect: function (dateText, inst) { $('#endDate').datepicker("option", 'minDate', new Date(dateText)); } , onClose: function () { $(this).focus(); } }); }); update code: var currentDate = new Date(); var currentMonth = currentDate.getMonth() + 1; var sixMonths = currentMonth + 6 currentDate.setMonth(currentDate.currentMonth, sixMonths); var myNewCurrentDate = new Date(currentDate) $('#startDate').datepicker('option', { minDate: myNewCurrentDate }); i am getting currentDate = NaN

    Read the article

  • jQuery datepicker - change "today" date?

    - by Newbie
    Hello! Is there a way to change the "today" date in jquery.ui datepicker? With today, I mean today (class="ui-datepicker-today") and not the minDate or the current-selected date! I figured out, that datepicker uses the system time for default values. Now I get the current date from my server and set it to my minDate. But I didn't find a way to set the today-date... It still uses my system date (there are some users out there whose systemdate is in the year 2000 or earlier). Can U help me plz?

    Read the article

  • Filtering data in an array.

    - by user276424
    Hi all, I have an array that has 30 date objects. The date objects are indexed in the array from the minimum date value to the maximum date value. What I would like to do is retrieve only 7 dates from the array. Out of the 7, the first one should be the minDate and the last should be the maxDate, with 5 dates in the middle. The 7 numbers should increment evenly from the minDate to the maxDate. How would I accomplish this? Hope I was clear. Thanks, Tonih

    Read the article

  • datepicker common options but different altField altFormat

    - by Legio X
    Using jquery-ui datepicker I would like to use altField and altFormat to 2 datepickers on the same page but I can't figure out how to add these 2 options which are specific to each datepicker along with my common set of options. Code sample below. #dt1 does not work, but #dt2 works. How can I get #dt1 to work while using the datepickerOpts? var datepickerOpts = { minDate: -2, changeMonth: true, changeYear: true, dateFormat: 'yy-mm-dd' }; $('#dt1').datepicker(datepickerOpts, {altField: '#alt1', altFormat: 'mm-dd-yy' }); $('#dt2').datepicker({ minDate: -2, changeMonth: true, changeYear: true, dateFormat: 'yy-mm-dd', altField: '#alt2', altFormat: '@' });

    Read the article

  • Minimum and maximum Date in date Picker in iphone

    - by Iphony
    I want to get minimum and maximum date from date picker but minimum date should be "- 18" of current date and maximum date should be "- 100" of current date. Suppose current year is 2018 then I want minimum date 2000 and maximum date 1918. what I have done so far is : NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents *components = [gregorian components:NSYearCalendarUnit fromDate:[NSDate date]]; NSInteger year = [components year]; int mindt = year - 18; int maxdt = year -100; // NSDate * MinDate = [components year] - 18; // NSDate * MaxDate = [components year] - 100; // self.datePicker.minimumDate = MinDate; // self.datePicker.maximumDate = MaxDate; but I cant get this integer to my date formate.. pls suggest any way ...

    Read the article

  • bulk insert and update with ADO.NET Entity Framework

    - by Keith Barrows
    I am writing a small application that does a lot of feed processing. I want to use LINQ EF for this as speed is not an issue, it is a single user app and, in the end, will only be used once a month. My questions revolves around the best way to do bulk inserts using LINQ EF. After parsing the incoming data stream I end up with a List of values. Since the end user may end up trying to import some duplicate data I would like to "clean" the data during insert rather than reading all the records, doing a for loop, rejecting records, then finally importing the remainder. This is what I am currently doing: DateTime minDate = dataTransferObject.Min(c => c.DoorOpen); DateTime maxDate = dataTransferObject.Max(c => c.DoorOpen); using (LabUseEntities myEntities = new LabUseEntities()) { var recCheck = myEntities.ImportDoorAccess.Where(a => a.DoorOpen >= minDate && a.DoorOpen <= maxDate).ToList(); if (recCheck.Count > 0) { foreach (ImportDoorAccess ida in recCheck) { DoorAudit da = dataTransferObject.Where(a => a.DoorOpen == ida.DoorOpen && a.CardNumber == ida.CardNumber).First(); if (da != null) da.DoInsert = false; } } ImportDoorAccess newIDA; foreach (DoorAudit newDoorAudit in dataTransferObject) { if (newDoorAudit.DoInsert) { newIDA = new ImportDoorAccess { CardNumber = newDoorAudit.CardNumber, Door = newDoorAudit.Door, DoorOpen = newDoorAudit.DoorOpen, Imported = newDoorAudit.Imported, RawData = newDoorAudit.RawData, UserName = newDoorAudit.UserName }; myEntities.AddToImportDoorAccess(newIDA); } } myEntities.SaveChanges(); } I am also getting this error: System.Data.UpdateException was unhandled Message="Unable to update the EntitySet 'ImportDoorAccess' because it has a DefiningQuery and no element exists in the element to support the current operation." Source="System.Data.SqlServerCe.Entity" What am I doing wrong? Any pointers are welcome.

    Read the article

  • JQuery DatePicker - pop calendar dialog on 'OnSelect' of another datepicker

    - by sajanyamaha
    I have two JQuery datepickers to select 'StartDate' and 'EndDate'.My requirement is to automatically popup the end date calendar after startDate has been selected. I have tried all the steps in COMMENTED HERE. The code here succesfully triggers the focus of 'EndDate' calendar,but it displays for a second and hides off. $(document).ready(function() { //Runs when tab is loaded var dateFormat = "dd/mm/yy"; var today=new Date(); today.setMonth(today.getMonth()-1); $("#ctl00_ContentPlaceHolder1_datepicker1").datepicker({ minDate: 0, dateFormat:dateFormat, //maxDate: '+12M +31D', onSelect: function(dateText, inst){ var the_date = new Date($.datepicker.parseDate(dateFormat,dateText)); //var end=(the_date.getDate()+1) + '/' + (the_date.getMonth()+1) + '/' + the_date.getFullYear(); $("#ctl00_ContentPlaceHolder1_datepicker2").datepicker('option', 'minDate', the_date); // TRIED ALL THESE //document.getElementById('ui-datepicker-div').style.display = 'block'; //document.getElementById('ui-datepicker-div').style.left = '635.5px'; //$("#ctl00_ContentPlaceHolder1_datepicker2").datepicker("show"); //$("#ctl00_ContentPlaceHolder1_datepicker2").datepicker(); //$("#ctl00_ContentPlaceHolder1_datepicker2").focus(); //$('#foo').slideUp(300).delay(800).fadeIn(400); //$("#ctl00_ContentPlaceHolder1_datepicker2").trigger("focus"); $('#ctl00_ContentPlaceHolder1_datepicker2').focus(); } }); $("#ctl00_ContentPlaceHolder1_datepicker2").datepicker({ //maxDate: '+12M +31D', dateFormat:dateFormat, onSelect: function(dateText, inst){ } }); });

    Read the article

  • End-date greater than start-date validation javascript not working properly

    - by ianco slovak
    I am trying to make a validation for my dates so that enddate to be greater than start date but is not working.What am i doing wrong? <head> <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script> <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" /> <script src="@Url.Content("~/Scripts/jquery-ui-1.8.19.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery-ui.unobtrusive.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery-ui.unobtrusive-0.5.0.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/gen_validatorv4.js")" type="text/javascript"></script> </head> @using (Html.BeginForm("SearchFree", "Reservation", FormMethod.Get,new {id = "form" })) { <h7>Introduceti perioada Rezervarii</h7> <div class="editor-label"> <label id="cautare" for="StartDate">Data Intrare: </label>@(Html.JQueryUI().Datepicker("StartDate").DateFormat("mm-dd-yy").MinDate(DateTime.Today).ShowButtonPanel(true).ChangeYear(true).ChangeMonth(true).NumberOfMonths(2)) </div> <div class="editor-label"> <label id="cautare" for="EndDate">Data Iesire:</label>@(Html.JQueryUI().Datepicker("EndDate").DateFormat("mm-dd-yy").MinDate(DateTime.Today).ShowButtonPanel(true).ChangeYear(true).ChangeMonth(true).NumberOfMonths(2)) </div> <p> <input id="buton1" type="submit" value="Cauta camere libere" /> </p> } <script type="text/javascript"> $(document).ready(function () { $.validator.addMethod("EndDate", function (value, element) { var startDate = $('.StartDate').val(); return Date.parse(startDate) <= Date.parse(value); } , "* End date must be after start date"); $('.form').validate(); }); </script>

    Read the article

1 2 3  | Next Page >