bootstrap-datepicker-rails 1.0.0.4 → 1.0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f53b412ccc47abdc41144ff0574a9c40156089f
4
- data.tar.gz: 7f00d20485ee4ecacdf36e365806e9dbe3a240e3
3
+ metadata.gz: 7ba1abfa642e1eacd1a1b297808b2bbb44416e8f
4
+ data.tar.gz: 9fc76aff52838f120efea7b1a0a5c21eda58d143
5
5
  SHA512:
6
- metadata.gz: 750051e8f825ebe9fbb92f6273d504decd92aa36ac4cd5e0e5e15873e859cf6939de192e7d6533dda77decd7d7a90387f61b91c141050d727020ddb41f9381dc
7
- data.tar.gz: 4b245b6c1f58f08b662e518c0d842a0a84655ac3285f0e4af63d31ace1d7fa03ffb8a1ce3ef93f2a6e5c7a602101601998dc40c26267f35cf15e99a164b97ebd
6
+ metadata.gz: f88ac51f05dfce7edd5bdd99e326dbaa57c737dfe3925ed46348e5eb6b1df9b00c3ae73fa89edb0343df4f7bbad1ae5c66ff23586d2d41224d4044ec5711dbdf
7
+ data.tar.gz: e40798409f4aa4ccbf936ab87c284391571c7da76e1a690f6a1dffcbb3a8be6900f0963836901617094e29df2609469cfe4d70bb7708820bb5510a0863b36dd9
data/README.md CHANGED
@@ -1,19 +1,9 @@
1
1
  # Bootstrap Datepicker for Rails
2
- Bootstrap is a toolkit from Twitter designed to kickstart development of webapps and sites.
3
- It includes base CSS and HTML for typography, forms, buttons, tables, grids, navigation, and more.
4
2
 
5
- http://twitter.github.com/bootstrap/
6
-
7
- Bootstrap Datepicker is a plugin for Bootstrap designed by Stefan Petre. It provides a stylish date picker for Bootstrap.
8
-
9
- http://www.eyecon.ro/bootstrap-datepicker/
10
-
11
- bootstrap-datepicker-rails project integrates Datepicker with Rails 3 assets pipeline.
3
+ bootstrap-datepicker-rails project integrates a datepicker with Rails 3 assets pipeline.
12
4
 
13
5
  http://github.com/Nerian/bootstrap-datepicker-rails
14
6
 
15
- It also integrates the improvements made by Andrew Rowls.
16
-
17
7
  https://github.com/eternicode/bootstrap-datepicker
18
8
 
19
9
  ## Rails > 3.1
@@ -1,5 +1,5 @@
1
1
  module BootstrapDatepickerRails
2
2
  module Rails
3
- VERSION = "1.0.0.4"
3
+ VERSION = "1.0.0.5"
4
4
  end
5
5
  end
@@ -133,6 +133,7 @@
133
133
  this.startDate = -Infinity;
134
134
  this.endDate = Infinity;
135
135
  this.daysOfWeekDisabled = [];
136
+ this.beforeShowDay = options.beforeShowDay || $.noop;
136
137
  this.setStartDate(options.startDate||this.element.data('date-startdate'));
137
138
  this.setEndDate(options.endDate||this.element.data('date-enddate'));
138
139
  this.setDaysOfWeekDisabled(options.daysOfWeekDisabled||this.element.data('date-days-of-week-disabled'));
@@ -466,7 +467,8 @@
466
467
  startMonth = this.startDate !== -Infinity ? this.startDate.getUTCMonth() : -Infinity,
467
468
  endYear = this.endDate !== Infinity ? this.endDate.getUTCFullYear() : Infinity,
468
469
  endMonth = this.endDate !== Infinity ? this.endDate.getUTCMonth() : Infinity,
469
- currentDate = this.date && this.date.valueOf();
470
+ currentDate = this.date && this.date.valueOf(),
471
+ tooltip;
470
472
  this.picker.find('.datepicker-days thead th.datepicker-switch')
471
473
  .text(dates[this.language].months[month]+' '+year);
472
474
  this.picker.find('tfoot th.today')
@@ -504,7 +506,23 @@
504
506
  }
505
507
  clsName = this.getClassNames(prevMonth);
506
508
  clsName.push('day');
507
- html.push('<td class="'+clsName.join(' ')+'">'+prevMonth.getUTCDate() + '</td>');
509
+
510
+ var before = this.beforeShowDay(prevMonth);
511
+ if (before === undefined)
512
+ before = {};
513
+ else if (typeof(before) === 'boolean')
514
+ before = {enabled: before};
515
+ else if (typeof(before) === 'string')
516
+ before = {classes: before};
517
+ if (before.enabled === false)
518
+ clsName.push('disabled');
519
+ if (before.classes)
520
+ clsName = clsName.concat(before.classes.split(/\s+/));
521
+ if (before.tooltip)
522
+ tooltip = before.tooltip;
523
+
524
+ clsName = $.unique(clsName);
525
+ html.push('<td class="'+clsName.join(' ')+'"' + (tooltip ? ' title="'+tooltip+'"' : '') + '>'+prevMonth.getUTCDate() + '</td>');
508
526
  if (prevMonth.getUTCDay() == this.weekEnd) {
509
527
  html.push('</tr>');
510
528
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap-datepicker-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.4
4
+ version: 1.0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gonzalo Rodríguez-Baltanás Díaz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-10 00:00:00.000000000 Z
11
+ date: 2013-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -184,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  version: '0'
185
185
  requirements: []
186
186
  rubyforge_project:
187
- rubygems_version: 2.0.3
187
+ rubygems_version: 2.0.2
188
188
  signing_key:
189
189
  specification_version: 4
190
190
  summary: A date picker for Twitter Bootstrap