Giter Site home page Giter Site logo

jquery.recurrenceinput.js's Introduction

jQuery recurrenceinput widget

jQuery plugin widget which support the definition of complex recurrence rulesets based on RFC5545, the iCalendar standard.

The recurrence rule string, generated by this package, should be directly usable in ics calendar files. It was developed for the Plone, but is completely independent of the web-framework. This widget is production ready and used in several sites.

image

Features

  • The recurrence widget supports most of the options of the iCalendar RRULE as well as EXDATE and RDATE.
  • It supports internationalization.
  • It supports predetermined recurrence rules, so called "templates".

Non-Features

This widget does not support all features of RRULE's. For example:

  • It does not support recurrence on smaller than daily basis.
  • In RRULE's end-dates can end either be in local time or in UTC. This widget only supports UTC, which means the start and end dates of the event as a whole, when exported may not be in local time. They must either specify a timezone or be in UTC. If the RRULE fed to the widget is in local time, this will be made into UTC with no timezone translation.
  • Any parameters will be ignored and stripped on saving the rule.

Requirements

Requires jQuery and jQuery Tools datetime widget and overlay support. It is currently being tested with jQuery 1.4, because that's what plone uses, and jQuery 1.7, because that is the last version supported by jQuery Tools.

jQuery 1.5 may work but is untested. Bugs in jQuery 1.6.4 means it does not work. jQuery Tools doesn't support jQuery 1.8 yet.

It's tested on Chromium 20 (Linux), Firefox 16 (Linux), IE 8 and IE 9 (Windows).

To Do

High priority:

  • 100% code coverage from tests (currently 95%).

Medium priority:

  • Make it possible to change the order of the fields as a part of the i18n. (jQuery templates)?
  • The human readable output should probably be done directly from the RRULE and not by using the form i18n, to improve the grammar and rule support.

Low priority:

  • Support more obscure RFC5545 options, either in the form or by providing warnings that the option is unsupported.

Developer information

To test, demo or develop jquery.recurrenceinput locally you need to run a local server, provided in the test_server.py script.

This server requires the dateutil module, so you must install it first. Here are some examples of how to do this, depending on your platform:

Debian/Ubuntu:

$ sudo apt-get install python-dateutil

A non-system Python 2 with setuptools or distribute installed:

$ <pathtopython>/easy_install python-dateutil

Then start the tests server like so:

$ python ./test_server.py

Open the demo pages http://localhost:8000/demo/input.html and http://localhost:8000/demo/localized.html

And Open the tests: http://localhost:8000/tests/tests.html

The demo/input.html document contains basic usecases and can be used when developing on this widget.

You also need to run the tests. These are located in tests/tests.js, and use the QUnit test framework. You run them by opening tests/test.html in the browser. The same issue with allowing Ajax from the local hard drive is in effect for the tests as well.

In the tests directory there is also a copy of jslint.js, for easy access. To run these you need to install a JavaScript engine, such as Rhino or SpiderMonkey. You then run it with:

$ js tests/jslint.js <file>

The following files should be jslinted:

src/jquery.recurrenceinput.js
src/tests.js

To keep the Coverage tests updated you need to install jscoverage ( http://siliconforks.com/jscoverage/ ). You then keep the coverage code updated by running:

jscoverage src/ coverage/

To run the coverage tests you go to http://localhost:8000/coverage/jscoverage.html?/tests/coveragetest.html

Contributors

This project was originally started by Rok Garbas.

Authors:
  • Lennart Regebro
  • Rok Garbas
  • Vilmos Somogyi
  • Johannes Raggam
  • Mike Rhodes
  • Kai Lautaportti

Thanks to Hexagon IT, http://www.hexagonit.fi/, who funded the main body of work, done by Lennart Regebro.

jquery.recurrenceinput.js's People

Contributors

regebro avatar garbas avatar thet avatar mikerhodes avatar vsomogyi avatar deiferni avatar vangheem avatar dokai avatar mauritsvanrees avatar ale-rt avatar aridor2006 avatar agitator avatar pbauer avatar bloodbare avatar

Stargazers

Mohamed Said avatar  avatar Tobias Schittkowski avatar Simon avatar  avatar Sam avatar 信鸽相知 avatar Sivakov Sergey avatar  avatar 徐精华 avatar  avatar Craig avatar  avatar Jason Murray avatar  avatar Tom Van Herreweghe avatar  avatar  avatar Adrian Rollett avatar Mayank Baluni avatar György Kiss avatar Cristian Tăbăcitu avatar Amit Jindal avatar Chris Jamieson avatar Ilya avatar Jan Broos avatar Tom King avatar Angel Luis Marin avatar Denis Seghetti avatar Aleksejs Semjonovs avatar  avatar Zeeshan avatar Alan Bacelar avatar Ryan McKeel avatar Franz Heinzmann avatar Vo Duy Tuan avatar Dimitris Marlagkoutsos avatar Sviatoslav Sydorenko (Святослав Сидоренко) avatar Eduardo Bohrer avatar Maurício avatar Eric Seyden avatar Rupert avatar Rob Jones avatar  avatar  avatar Amit Agarwal avatar  avatar  avatar Angus H. avatar Izon Thomaz Mielke avatar Yueping Qian avatar Rada Bogdan avatar Iljoong Hwang avatar Mark Penner avatar David Wu avatar Shankar Dhanasekaran avatar foo9 avatar Marc Teichtahl avatar Jonathan Counihan avatar Darrell Wu avatar Gene avatar  avatar Nicholas Petersen avatar Matt Danskine avatar Enrique Ibarra avatar Pedro Coutinho avatar Enrique Becerra avatar Vadim Zozulya avatar Michał Młodziński avatar AgBorkowski avatar  avatar Aram Kocharyan avatar  avatar Anibal avatar Mike Pack avatar Edward Middleton avatar Nico N avatar Thiago Sigrist avatar GT avatar Ismael Hamed avatar Simon Thépot avatar Mathieu DSTP avatar Sheldon Baker avatar Aitor Alejandro Herrera avatar Mojtaba Koosej avatar Zaher Ghaibeh avatar Todd Ballard avatar  avatar Benjamin Harris avatar Mathieu Lajugie avatar Justin Cummings avatar Pat Buchanan avatar Andrey Yatsyk avatar Oğuz Çelikdemir avatar Drew Dara-Abrams avatar Justin Sisley avatar Davide Malagoli avatar Matt Mueller avatar Brad Gorman avatar  avatar

Watchers

James Gardner avatar David Bain avatar Mikko Ohtamaa avatar Tim Knapp avatar TsungWei Hu avatar Pelle Krøgholt avatar Jesse Snyder avatar  avatar Rob Porter avatar Vincent Fretin avatar Sean Chen avatar Rodrigo Ferreira de Souza avatar ichim-david avatar AgBorkowski avatar Shane Graber avatar Mauro Amico avatar Leonardo J. Caballero G. avatar Esa-Matti Suuronen avatar Robert Niederreiter avatar send2vinnie avatar Cleber J Santos avatar  avatar Thomas Desvenain avatar Gildardo Bautista avatar  avatar Rudá Porto Filgueiras avatar Armin Stross-Radschinski avatar Cris Ewing avatar Davi Medeiros avatar  avatar Rijk Stofberg avatar  avatar Fulvio Casali avatar David Siedband avatar Eric BREHAULT avatar Zoltan Szabo avatar Takashi NAGAI avatar Manabu TERADA avatar  avatar Joao S. O. Bueno avatar Jean-Philippe Camguilhem  avatar  avatar Davide Moro avatar Steve Seidenthal avatar Danny Butaye avatar Rizwan avatar andreasma avatar  avatar Georg Gogo. BERNHARD avatar 4teamwork Jenkins avatar Jiang dongjin avatar Roché Compaan avatar T. Kim Nguyen avatar Thomas Clement Mogensen avatar James Cloos avatar  avatar Hans-Peter Locher avatar Ralph Jacobs avatar Chris Calloway avatar Franklin Kingma avatar Hugo Rodriguez avatar Juan Carlos Coruña avatar Maik Röder avatar Khairil Yusof avatar Espen Moe-Nilssen avatar  avatar Laurent Lasudry avatar tiazma avatar  avatar Vito Falco avatar Hanno Schulz avatar Gil Forcada Codinachs avatar André NUYENS avatar Alexandru Ghica avatar  avatar DHietpas avatar Stéphane Moussiaux avatar  avatar Max Jakob avatar  avatar Gauthier Bastien avatar Stefaner Benjamin avatar Luca avatar  avatar  avatar Lucas Aquino avatar Alice Tseng avatar Ian Anderson avatar Federica D'Elia avatar Adam avatar Jason Craig avatar Julien Stegle avatar Jess Henderson avatar Rafahela avatar Julien Marinescu avatar Simon Delcourt avatar Carlos Malave avatar Bogdan Ciobanu avatar  avatar Jeff Terstriep avatar

jquery.recurrenceinput.js's Issues

Add support for IE8

When loading a recurrence rule in Internet Explorer 8, with a jquery version > 1.7.0 (I tried with 1.7.1, and 1.7.2) I get an "Object Expected" error in the console, and the rule dialog isn't initialized.

Thanks!

  <html>

  <head>
      <title>JQuery.RecurrenceInput Demo</title>

      <link type="text/css" href="jquery.tools.dateinput.css" rel="stylesheet"></link>
      <link type="text/css" href="jquery.recurrenceinput.css" rel="stylesheet"></link>
      <link type="text/css" href="overlays.css" rel="stylesheet"></link>
      <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>

      <script type="text/javascript" src="../lib/jquery.tmpl-beta1.js"></script>
      <script type="text/javascript" src="../lib/jquery.tools.dateinput-1.2.5.js"></script>
      <script type="text/javascript" src="../lib/jquery.tools.overlay-1.2.5.js"></script>
      <script type="text/javascript" src="../src/jquery.recurrenceinput.js"></script>
  </head>

  <body>
      <h2>Minimal setup</h2>

      <!-- Make a text area for the RRULE, which also works as a
           non-javascript fallback -->
      <textarea name="repeat">RRULE:FREQ=DAILY;INTERVAL=2;COUNT=5</textarea>
      <!-- Make the text area a recurrenceinput -->
      <script type="text/javascript">
          $("textarea[name=repeat]").recurrenceinput();
      </script>

  </body>

  </html>

Weekly RRULE on 'Mo,Tu,We,Th,Fr,Sa' gets parsed as weekdays and forgets the Saturday when resaving

Hi,

Firstly, thanks for providing a great plugin. I wanted to raise a possible issue where a Weekly recurring event gets incorrectly saved as a Weekday rrule after it is opened and resaved. It seems setting a weekly recurrence of "Mo,Tu,We,Th,Fr,Sa" matches the Weekdays recurrence rule format ("Mo,Tu,We,Th,Fr") without check for the occurence of the ",Sa", leading to the "Saturday" being lost.

From my tests this seems to happen only in the exact situation outlined above where an event is Weekly and "Mo,Tu,We,Th,Fr,Sa". Any other combination of days is not affected by this as it will not match "Mo,Tu,We,Th,Fr". I believe this is because the Weekdays rule comes before the Weekly rule here, thus matching it without checking for the Saturday on the end.

// RECURRENCE TEMPLATES (Line 41)
rtemplate: { ..., weekdays: { rrule: 'FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR', fields: [ 'rirangeoptions' ] }, weekly: { rrule: 'FREQ=WEEKLY', fields: [ 'riweeklyinterval', 'riweeklyweekdays', 'rirangeoptions' ] }, ... }

I have worked on finding a fix locally, with the intention of then forking the code and submitting a PR, but have been unable to solve the problem myself. Is anyone able to help?

Kind regards, Kyle

No copyright/license information

There isn't any copyright or license file in the repository. Given the way copyright law works, this means no one is allowed to do anything with the code, which is probably not what you want.

No way to destroy the plugin once intialized

Once the plugin is initialized, there is no way to destroy it. Also after recurrenceinput is initialized, if we change the textbox using some other source, the recurrence rule is not updated

get rid of jquerytools dependencies

get rid of jquerytools dependencies by not depending on those libs at all and letting integrators choose their own libs.

ship with other mockup's picks of libs for demo/tests: pickadate instead of jquerytools dateinput, modal instead of jquerytools overlay.

Eventually migrate tests to Mocha

Mocha is used with mockup and seems to have much momentum at the moment.
Migrating tests shouldn't be too hard.
There is no guarantee, but maybe this can fix issue #8, the heisenbugs, assuming they provide better support for async calls, which might the cause of the heisenbugs.

recurrenceinput does not support EXDATE/RDATE definitions over multiple lines

recurrenceinput does not support EXDATE or RDATE definitions over multiple lines like this (real-world example):

RRULE:FREQ=WEEKLY;INTERVAL=1;UNTIL=20130305T225959Z
EXDATE;TZID=Europe/Berlin:20121031T140000
EXDATE;TZID=Europe/Berlin:20121226T140000
EXDATE;TZID=Europe/Berlin:20130102T140000
EXDATE;TZID=Europe/Berlin:20130206T140000
EXDATE;TZID=Europe/Berlin:20130213T140000
EXDATE;TZID=Europe/Berlin:20130220T140000
EXDATE;TZID=Europe/Berlin:20130227T140000

tough, the recurrenceinput does support EXDATE/RDATE definitions like:

EXDATE:20130227T140000,20121031T140000,20130102T140000

use grunt, use bower

Upgrade build-infrastructure, like in plone/mockup:

  • use grunt taskrunner as build tool
  • use bower for managing dependencies
  • eventually use yeoman

The tests are plagued by heisenbugs

Many tests will not work reliably. Some tests will always fail if you reload the page. Some tests will fail every second reload, and pass every second reload. All tests will however run if run in isolation. Trying to debug the issue (in any case including alerts or having a debugger) will make the tests pass.

I suspect timing issues, but adding delays seem to make no difference.

I suspect a JS/jQuery/qUnit guru is needed to look at this.

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.