We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Change the date

Thread ID:

Created:

Updated:

Platform:

Replies:

117822 Dec 22,2014 03:16 PM UTC Dec 26,2014 04:34 AM UTC JavaScript 3
loading
Tags: ejDatePicker
Stefano Enrico
Asked On December 22, 2014 03:16 PM UTC

How to change the date in datepicker with api?

$(this).ejDatePicker({
locale: 'it-IT',
dateFormat: 'dd/MM/yyyy',
buttonText: 'Oggi',
highlightWeekend: true
});

[...]

$(this).ejDatePicker('option', 'value', new Date()); //  ?????

[...]

var dataString = $(this).ejDatePicker('getValue');    // empty

Kaliswaran Shanmuga Sundaram [Syncfusion]
Replied On December 23, 2014 10:04 AM UTC

Hi Stefano,

Thanks for using Syncfusion products.

We can set the value for datepicker control by using the API called “value”. It is used to specify the value for datepicker and its accepts the string or Date object as a value. For your convenience we have prepared a simple sample to show case how to set or get the value of datepicker and it can be downloadable from below link.

Sample Link: DatePicker-sample

In the attached sample, we have used the following code blocks to get or sets the date value.

[Script]

 

// Creating an object to the DatePicker Element

   var datepickObj = $("#datepick").data('ejDatePicker');

 

// Set a value to the DatePicker

   datepickObj.option('value', new Date()); 

 

// Get a value of DatePicker

   var value = datepickObj.option('value');

 

Also if you want to know more about our components to getting started, please find the below link.

http://help.syncfusion.com/web

In order to know more detailed information please refer the below link which includes all the details to get started with our components.

http://help.syncfusion.com/cr/js

Also you can find all the samples of our components in the following link location.

http://js.syncfusion.com/demos/web/

Please let us know if you have further queries.

Regards,

Kaliswaran S


Stefano Enrico
Replied On December 23, 2014 11:09 AM UTC

Ok, solved.
Thanks

Kaliswaran Shanmuga Sundaram [Syncfusion]
Replied On December 26, 2014 04:34 AM UTC

Hi Stefano,
  
        We are glad to hear the provided solution helps for you. Please get back to us if you would require an further assistance.

Regards,
Kaliswaran S

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;