Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- Add translation (en/fr) #4

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open

Conversation

erodataM
Copy link

  • Add Google Analytics like menu

- Add Google Analytics like menu
@erodataM erodataM closed this Nov 19, 2014
@erodataM erodataM reopened this Nov 19, 2014
@erodataM
Copy link
Author

For our project we needed a Google analytics like menu (possibility to select 2 ranges).
It's a new option named : GAMenu (set it to true).
screen

@ghola
Copy link
Contributor

ghola commented Nov 19, 2014

Hello Lionel, we are pleased to see you taking an interest in this daterangepicker implementation and we thank you for the contribution.

However, having studied your use case and the implementation, it seems that the current widget is rather limited. For example, what happens if someone else wants 3 ranges, or they want 2 ranges with a different menu than your current one?

It occurred to us that we should first open the daterangepicker a little bit more and allow third parties to implement custom plugins without affecting the base widget. This way we would allow for any number of menu implementations, any number of data formats and any number of ranges. Having done that, it would be easier to build variations of the widget and at the same time have better control over the core code.

We will leave the issue open for now so that others that require a GA menu can refer to your implementation. Once we make the above mentioned refactoring to our code we will let you know. Unfortunately we can't give a timeline/deadline on this.

@erodataM
Copy link
Author

Thank you for answer.
You're right, better idea to allow third parties to implement custom plugins.
I used your work, so that's why I wanted to share mine =)
(I'm french, sorry for my english)
There is (at least) one issue with reposition function,due to the new menu, very easy to solve, I already did it and i'll push it tomorrow =)

@Anselme
Copy link

Anselme commented May 13, 2015

Hello erodataM,

if you want a french version of the datarangepicker, no need to re-write the code.
You can use the option as follow :

 $(function() { 
      $("#form_dates").daterangepicker({
      initialText: 'Choisir un interval de dates...',
      applyButtonText: 'Appliquer',
      clearButtonText: 'Ré-initialiser',
      cancelButtonText: 'Annuler',
      datepickerOptions : {
        numberOfMonths: 2,
        dayNamesMin: [ "Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam" ],
        monthNames: [ "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juli", "August", "September", "Oktober", "November", "December" ]
        },
      presetRanges: [
        {text: 'Depuis le début du mois', dateStart: function() { return moment().startOf('month') }, dateEnd: function() { return moment() } },
        {text: 'Le mois précédent', dateStart: function() { return moment().subtract('month', 1).startOf('month') }, dateEnd: function() { return moment().subtract('month', 1).endOf('month') } },
        {text: 'Depuis le début de l\'année', dateStart: function() { return moment().startOf('year') }, dateEnd: function() { return moment() } }
      ],
      onChange: function(){$('#form-date-range').submit();}
      });
  });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants