Giter Site home page Giter Site logo

Comments (7)

longbill avatar longbill commented on August 16, 2024

hi,

  1. two calendars can not move simultaneously, if I do so, user could only select a date range less than two months long
  2. 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
  3. for holidays, please check the lasted doc on my demo page. there’s a beforeShowDay callback
  4. 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.

arjunmenon avatar arjunmenon commented on August 16, 2024

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.

longbill avatar longbill commented on August 16, 2024

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.

arjunmenon avatar arjunmenon commented on August 16, 2024

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.

longbill avatar longbill commented on August 16, 2024

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.

arjunmenon avatar arjunmenon commented on August 16, 2024

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.

alexdpunkt avatar alexdpunkt commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.