Permalink
Browse files

rename menu methods

  • Loading branch information...
1 parent 66e0459 commit 8235f25f6c2e1f688f81a70a76589f3994a0feca @tj tj committed Oct 17, 2012
Showing with 8 additions and 11 deletions.
  1. +5 −8 Readme.md
  2. +2 −2 lib/calendar.js
  3. +1 −1 test/index.html
View
@@ -39,17 +39,14 @@ cal.el.appendTo('body');
Show the given `date`. This does _not_ select the given date,
it simply ensures that it is visible in the current view.
-### Calendar#monthMenu()
+### Calendar#showMonthSelect()
- Adds a month dropdown menu to allow jumping to selected month.
+ Add month selection input.
-### Calendar#yearMenu([from], [to])
+### Calendar#showYearSelect([from], [to])
- Adds a year dropdown menu to allow jumping to selected year. `From` specifies the first year shown in the dropdown and `to` the last year. This means that if `to` is less than `from`, the years will be listed in descending order.
-
- If `from`/`to` are both not specified the dropdown defaults to -/+ 10 years from the calendar's date.
-
- If only `from` specified it defaults `to` +20 years from that year.
+ Add year selection input, with optional range specified by `from` and `to`,
+ which default to the current year -10 / +10.
### Calendar#prev()
View
@@ -106,7 +106,7 @@ Calendar.prototype.show = function(date){
* @api public
*/
-Calendar.prototype.yearMenu = function(from, to){
+Calendar.prototype.showYearSelect = function(from, to){
if (!from) {
from = this._date.getFullYear() - 10;
to = this._date.getFullYear() + 10;
@@ -124,7 +124,7 @@ Calendar.prototype.yearMenu = function(from, to){
* @api public
*/
-Calendar.prototype.monthMenu = function(){
+Calendar.prototype.showMonthSelect = function(){
this.days.monthMenu();
this.show(this._date);
return this;
View
@@ -23,7 +23,7 @@
<script src="../build/build.js"></script>
<script>
var Calendar = require('calendar');
- var one = new Calendar().monthMenu().yearMenu();
+ var one = new Calendar().showMonthSelect().showYearSelect();
one.on('view change', function(date, action){
console.log(action);

0 comments on commit 8235f25

Please sign in to comment.