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

Drop jQuery dependency #350

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
init
  • Loading branch information
GeoSot committed Mar 8, 2020
commit daefd245fa3f50e2b93250ac847aa2c95e31c913
34 changes: 31 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CLNDR.js
========

CLNDR is a jQuery calendar plugin. It was created -- you've heard this before --
CLNDR is a vanilla Javascript calendar plugin. It was created -- you've heard this before --
out of frustration with the lack of truly dynamic front-end calendar plugins out
there.

Expand Down Expand Up @@ -47,7 +47,7 @@ submitting a pull request or issue!
Dependencies
------------

[jQuery](http://jquery.com/download/) and [Moment.js](http://momentjs.com/) are
[Moment.js](http://momentjs.com/) are
depended upon. By default CLNDR tries to use
[Underscore.js](http://underscorejs.org/)'s `_.template()` function, however if
you specify a custom rendering function (see documentation below) Underscore
Expand Down Expand Up @@ -107,6 +107,8 @@ that's an aside). Instead, CLNDR asks you to create a template and in return it
supplies your template with a great set of objects that will get you up and
running in a few lines.

CLNDR can be used along with jQuery or with simple javascript

### The 'Days' Array

Here's a typical CLNDR template. It's got a controller section and a grid
Expand Down Expand Up @@ -172,12 +174,17 @@ Usage
CLNDR leans on the awesome work done in Underscore and moment. These are
requirements unless you are using a different rendering engine, in which case
Underscore is not a requirement). Do be sure to include them in your `<head>`
before clndr.js. It is a jQuery plugin, so naturally you'll need that as well.
before clndr.js.

The bare minimum (CLNDR includes a default template):

```javascript
$('.parent-element').clndr();

//OR

new Clndr('.parent-element')

```

With all of the available options:
Expand Down Expand Up @@ -475,6 +482,17 @@ $('#calendar').clndr({
startDate: 'start'
}
});

//OR

new Clndr('#calendar',{
events: lotsOfEvents,
multiDayEvents: {
endDate: 'end',
startDate: 'start'
}
});

```

When looping through days in my template, 'Monday to Friday Event' will be
Expand Down Expand Up @@ -553,6 +571,15 @@ $('#calendar').clndr({
startDate: '2015-05-06'
}
});

//OR

new Clndr('#calendar',{
constraints: {
endDate: '2015-07-16',
startDate: '2015-05-06'
}
});
```

Now your calendar's next and previous buttons will only work within this date
Expand Down Expand Up @@ -601,6 +628,7 @@ events array.
```javascript
// Create a CLNDR and save the instance as myCalendar
var myCalendar = $('#myCalendar').clndr();
//OR var my calendar =new Clndr('#calendar')

// Go to the next month
myCalendar.forward();
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "A jQuery calendar plugin that uses HTML templates.",
"author": "Kyle Stetz",
"contributors": [
"Mike Gioia <mike@teachboost.com>"
"Mike Gioia <mike@teachboost.com>",
"George Sotiropoulos <geo.sotis@gmail.com> (https://github.com/GeoSot)"
],
"license": "MIT",
"repository": {
Expand Down
Loading