GithubHelp home page GithubHelp logo

sensortower / daterangepicker Goto Github PK

View Code? Open in Web Editor NEW
302.0 302.0 105.0 1.09 MB

ARCHIVED - Please find details in https://github.com/sensortower/overseer/issues/33139. Date range picker component for the modern web

Home Page: https://sensortower.github.io/daterangepicker/

License: MIT License

HTML 12.13% CoffeeScript 61.32% CSS 17.29% JavaScript 9.26%

daterangepicker's People

Contributors

berrberr avatar danielruf avatar diziet avatar ilnurnasyrov-st avatar iulia-soimaru avatar ixti avatar oliver-k-yeh avatar petethepig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

daterangepicker's Issues

Namespace CSS classes

Problem: a lot of CSS class names have very generic names (.controls, .calendar, .hidden). This may cause problems when integrating with existing websites.

Solution: namespace class names (.dtp-controls, .dtp-calendar, .dtp-hidden).

Uncaught ReferenceError: ko is not defined

I love this plugin. However I can't get it to work. I use Jquery.
Must I include knockoutjs on the page? Hope not because I don't wish to have knockout included in my project. Kindly advise

daterangepicker.js:122 Uncaught ReferenceError: ko is not defined
at daterangepicker.js:122
at daterangepicker.js:1207

Week number

Currently, there is no way to display week numbers in the calendar table. It would be great to add a new column before week days (as shown on the attached image). Thank you!

Képernyőkép_2019-09-17_11-38-15

Wrong end date value

When I click on for example 31st Dec, I get the 30th Dec value. Furthermore, my observable(knockout) only updates after I change start date

Add ability for null dates (clear)

It would be great if there were an option to have no date(s) selected for the start and/or end dates. This would allow the user to specify no date range at all, a start date but no ending date, or an ending date with no start date. Essentially, add a clear button to both start and end dates.

Translate

How can I change/translate the texts?

period is not working for jquery

Can't we use it without knockoutjs ?

When I am passiing period, it is not working
$(".daterangepicker-field").daterangepicker({
forceUpdate: true,
period: ('day' | 'week' | 'month' | 'quarter' | 'year'),
periods:'quarter',
single:true,
callback: function(startDate, endDate, period){
var title = startDate.format('L') + ' – ' + endDate.format('L');
$(this).val(title)
}
});

Setting timeZone to null does not have any effect

In the documentation, its stated:

Sets time zone. If you want to use user's computer time zone, pass null

However the code which implements this, will always cast the null into "UTC".
Config.prototype._timeZone = function(val) { return ko.observable(val || 'UTC'); }

So passing null does not have the desired effect, and instead its reverted to UTC.

Setup with last Work Week, and Last Month

Hi, many apps use fiscal weeks from Monday to Sunday.

In the examples, its currently has last 7 days, can you please expose Last Work Week (Monday through Sunday)

In the docs, its not clear if two dates start and end are available (to be posted back to server), for e.g. in Standalone & Single how can we get the start and end dates of the selection?. Are there 2 text box inputs?

thanks

Period not working

Hi,

The period selection option is not working for me at all.Below is my piece of code.
`$(".daterangepicker-field").daterangepicker({
forceUpdate: true,
ranges:{
'Last 30 days': [moment().subtract(29, 'days'), moment()],
'Last 90 days': [moment().subtract(89, 'days'), moment()],
},
periods:['month','quarter','year'],
period: ('month' | 'quarter' | 'year')
},
function (startDate, endDate, period) {
$(this).val(startDate.format('L') + ' – ' + endDate.format('L'))

});`

Below is screenshot

my_daterange_picker

predict month selection

hi,
is there any option to predict month selection.
if i select march is the start of month selection automatically predict april is the end month.

Change Calendar to match company Fiscal

How can I change the calendar to match a company Fiscal Year

Example

Q1 - 10/282017 - 01/27/2018
Q2 - 01/28/2018 - 04/28/2018
Q3 - 04/29/2018 - 07/28/2018
Q4 - 07/29/2018 - 11/03/2018

Add configuration for date format

Amazing plugin!

Only downside I can find is that the custom date inputs are formatted using the American style date mm/dd/yyyy, so it would be nice to choose a custom format such as dd/mm/yyyy.

How to add financial year

In period section have lot of options (Days, Weeks, Month, Quarter, Year). How to add financial year in this calendar.

Daterangepicker opens behind the bootstrap modal

I'm loving this plugin it has almost all the functionalities and the look is also so decent. I implemented this to my application where user has to select the date in a bootstrap modal. Somehow the picker opens up behind the modal fade screen where user can not interact with the plugin. Is there any way I can resolve this?

Regards and thanks for the great work!

Issue : Setting 'firstDayOfWeek' is Disturbing dates

https://user-images.githubusercontent.com/56686440/67014986-3820fc00-f10f-11e9-89de-fcdcaba28803.png

Hi
I have attached above the screenshot for reference.

I have made some customization in this plugin and attached screenshot is showing week Period view that means i can select weeks. One whole week is selected upon clicking any row of calendar.
Now,
I had my requirement to set the first day of week according to configuration. Lets say if First day of week is Monday then it should appear as first day and date should be accordingly adjusted. I am facing this issue that week days are rotated correctly but the date is not rotating.

For Eg. 29th Sept is appearing under Monday but it should appear under Sunday. How can I fix this Issue ?

Thanks

Title Change

Possible to change title in calendar?
Ex: I want change "Year" to "Cal Year"

uninitialized daterangepicker

As of now, binding the daterangerpicker input to an uninitialized knockout observable is not supported.
This makes is hard to use in forms which will be forced to always get/post the default initialized values.
can this restriction be removed?

daterangepicker with RequireJS

We're using RiotJS as our framework with RequireJS and can't seem to get this to initialize with jQuery. Does this library support RequireJS?

Add checks in Config

Add checks to prevent typos & such:

$('input').daterangepicker({period: 'quartre'}); // typo
// should throw an error "invalid period"

Limit Date difference between to dates

Is there any option to limit the difference between to dates? For example I want something that checks if
end.diff(start, 'days') > 365
Then reset the startDate or endDate so the difference will be equal with desired interval.

Cannot get it to work

Hi all,
I am trying to use the datepicker in my website but cannot get it to work. I am including all these libraries:
'moment.min.js', 'moment-with-locales.min.js','timepicker.js','daterangepicker.js', 'daterangepicker.timesupport.js',.
Then I have a simple input tag <input id="date1" /> and a jQuery call $("#date1").daterangepicker();
and nothing shows up, except a TypeError: n.tz is not a function error in the console.
Any help?
Thank you.

Custom Quarters

Is there an option to edit the quarters (Q1, Q2, Q3, Q4) and also change the first month of the year and hence the span of a quarter.
For eg: I want my year to start in on 1st April and end on 31st March (According to Indian Financial Calender) and Q1 to be replaced by Quarter-1 and Q1 should start on 1st April and end three months after that. Is there a way I can achieve this using this library ?

Decrement or Increment month

Hi There

I am wondering if its possible to do something like this in ranges

function cb(start, end) {
    $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
}

$('#reportrange').daterangepicker({
startDate: start,
endDate: end,
ranges: {
'Today': [moment(), moment()],
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
'Last 7 Days': [moment().subtract(6, 'days'), moment()],
'Last 30 Days': [moment().subtract(29, 'days'), moment()],
'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')],
'Decrement Month': [moment(start).subtract(1, 'month').startOf('month'), moment(end).subtract(1, 'month').endOf('month')]
}
}, cb);

var start = moment().startOf('month');
var end = moment().endOf('month');
cb(start, end);

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.