Comments (7)
hi,
- two calendars can not move simultaneously, if I do so, user could only select a date range less than two months long
- for applying the date range picker on a span instead of an input, please look at my demo. you should provide both setValue and getValue functions
- for holidays, please check the lasted doc on my demo page. there’s a beforeShowDay callback
- for single date picker mode issue, I will check it later
Regards,
Chunlong
sent from mac
在 2014年5月28日 星期三,下午1:52,Arjun Menon 写道:
Hi
If you close the single datepicker after selecting a date, that selection is not reflected in the calendar, when opened again, as opposed to being shown and highlighted in the daterange calendar.
Also, I am using a span tag(single calendar), so if i set default date, it does not reflect on the calendar.
For specific cases, is it possible to add holiday/events information to the calendar? User hovers over certain date, tooltip shows event info.
Some minor suggestions
limit previous/later display of calendar when startDate and endDate initialized. As possible with simple jquery datepicker.
highlight weekends
setDefault date value inside daterangepicker parameter instead of input or span tag. Easier to update
for daterange, move both calendars simultaneously.Thanks.
—
Reply to this email directly or view it on GitHub (#29).
from jquery-date-range-picker.
Hi
I have used your demo as ref for span tag. But cant initialize default date, if i replace the text value from "span" to a particular date. Thats the reason i suggested to initialize defaultDate from the daterangepicker parameter. Using setDate, the span wont even update. (referring to your old version)
In your new version, now the span element does not even update with the selected date as in your previous version.
In your new version i got an idea to use the beforeShowDate, but the tooltip is basic. Possible to add the bootstrap tooltip to it?
Thanks
(ps - using scroll wheel to navigate months, will be nice UI)
from jquery-date-range-picker.
Hi,
I am sorry that I made a mistake when calling the setValue/getValue, not it is fixed. demo works well now.
The reason why I do not use a defaultDate is you can set the dates in the INPUT or SPAN. every time the date range picker opens, it calls getValue to get data from your DOM. the data in your dom IS actually the ‘defaultDate’.
Regards,
Chunlong
sent from mac
在 2014年5月28日 星期三,下午4:52,Arjun Menon 写道:
Hi
I have used your demo as ref for span tag. But cant initialize default date, if i replace the text value from "span" to a particular date. Thats the reason i suggested to initialize defaultDate from the daterangepicker parameter. Using setDate, the span wont even update. (referring to your old version)
In your new version, now the span element does not even update with the selected date as in your previous version.
In your new version i got an idea to use the beforeShowDate, but the tooltip is basic. Possible to add the bootstrap tooltip to it?
Thanks
(ps - using scroll wheel to navigate months, will be nice UI)—
Reply to this email directly or view it on GitHub (#29 (comment)).
from jquery-date-range-picker.
In that case i would require your help. I have set a diff date format. How can I automatically update the defaultDate every day inside the span element.
Thanks.
from jquery-date-range-picker.
for a different date format, please configure format
. please check the documentation, it will lead you to moment format page.
sent from mac
在 2014年5月29日 星期四,上午3:30,Arjun Menon 写道:
In that case i would require your help. I have set a diff date format. How can I automatically update the defaultDate every day inside the span element.
Thanks.—
Reply to this email directly or view it on GitHub (#29 (comment)).
from jquery-date-range-picker.
Is there any specific way the default value needs to be set/called. This is how I set -
<input type="text" value="Sun, 8 Jun 2014" class="form-control" id="date-range9" style="background-color:#49e; color:white;padding:3px; cursor:pointer; border-radius:4px; text-align:center;border:0;line-height:normal;" readonly >
But the single calendar is not picking the value.
Also, Can you provide an example to set certain dates, based on month, in the beforeShowday param marked as events. Cant make out from your demo page. I will love you.
Thanks.
from jquery-date-range-picker.
The datepicker indeed does have an issue with single dates.
Problem is the open
function - if you change it like this, it works for single dates too.
function open(animationTime)
{
calcPosition();
var __default_string = opt.getValue.call(selfDom);
var defaults = __default_string ? __default_string.split( opt.separator ) : '';
if (defaults && defaults.length >= 1)
{
var ___format = opt.format;
if (___format.match(/Do/))
{
___format = ___format.replace(/Do/,'D');
defaults[0] = defaults[0].replace(/(\d+)(th|nd|st)/,'$1');
if(defaults.length > 1)
defaults[1] = defaults[1].replace(/(\d+)(th|nd|st)/,'$1');
}
// set initiated to avoid triggerring datepicker-change event
initiated = false;
if(defaults.length > 1) {
// set range
setDateRange(moment(defaults[0], ___format).toDate(), moment(defaults[1], ___format).toDate());
} else {
// set single date!
setDateRange(moment(defaults[0], ___format).toDate(), moment(defaults[0], ___format).toDate());
}
initiated = true;
}
box.slideDown(animationTime);
}
@longbill can you please update the code? Thanks!
from jquery-date-range-picker.
Related Issues (20)
- Options to display more than 2 months on mobile
- how to fix Uncaught TypeError: Cannot read property 'left' of undefined jquery.daterangepicker.source.js:1297 HOT 1
- Today button HOT 1
- Shortcut for "This week" "This month" HOT 2
- Can week selection be from Sat to Fri
- [BUG] form with date-range-picker submits extra hour and minute params
- Incomplete french translation
- Missing croatian language HOT 2
- Why classed are cleared after use setDateRange
- Prev button not working if Init with setValue for start and end dates
- Add Greek translation HOT 3
- Is this project maintained? HOT 4
- onChangeView event or .invalid state on .prev and .next HOT 2
- How to disable some days for picking? HOT 1
- Missing Netherland language HOT 1
- How to use date and time data in the custom top bar? HOT 1
- moment => luxon HOT 1
- Migrate from Moment.js to Luxon
- Can I choose date after a date is disabled ? HOT 1
- box is undefined HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-date-range-picker.