bootstrap-datetimepicker 2.1.30

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1eb443f41edcbbb92a8baed13667d485368785eb
4
+ data.tar.gz: 509fbcf86842d5408cfc1b392069d39bc367f0ef
5
+ SHA512:
6
+ metadata.gz: 06a63a379939124e79097646b6c6380ca5b45e34bc3e399e8ea6260634329b5479fd42ecff65dd7997682acda1aa4a9a3f82afab456756cf37b49fd7cf2b67b1
7
+ data.tar.gz: 2c7704f382dab00f802fbf929a6d4e38b87f5dd6f6b2271312bdf089275dfc70362b897abd18d261c90fdc6e24f4ce35f908db91ba3e15c3c8a260a333609114
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in bootstrap-datetimepicker.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Pierrick Rouxel
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,37 @@
1
+ # bootstrap-datetimepicker
2
+
3
+ Date/time picker widget for Twitter Bootstrap v3 (from Eonasdan)
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'bootstrap-datetimepicker'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install bootstrap-datetimepicker
18
+
19
+ ## Compatibility
20
+
21
+ * Rails
22
+ * Middleman
23
+ * Maybe other
24
+
25
+ ## Thanks
26
+
27
+ Thanks to Eonasdan and others contributors for this great plugin.
28
+ [https://github.com/Eonasdan/bootstrap-datetimepicker](https://github.com/Eonasdan/bootstrap-datetimepicker)
29
+
30
+
31
+ ## Contributing
32
+
33
+ 1. Fork it ( http://github.com/<my-github-username>/bootstrap-datetimepicker/fork )
34
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
35
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
36
+ 4. Push to the branch (`git push origin my-new-feature`)
37
+ 5. Create new Pull Request
@@ -0,0 +1,60 @@
1
+ require 'bundler/gem_tasks'
2
+
3
+ require 'git'
4
+
5
+ REPOSITORY = 'https://github.com/Eonasdan/bootstrap-datetimepicker.git'
6
+ NAME = 'bootstrap-datetimepicker'
7
+
8
+ desc 'Import assets from repository (required: VERSION=x)'
9
+ task :import_assets do
10
+ input_files = %w(
11
+ bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css
12
+ bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js
13
+ )
14
+
15
+ output_files = %w(
16
+ stylesheets/bootstrap-datetimepicker.css
17
+ javascripts/bootstrap-datetimepicker.js
18
+ )
19
+
20
+ assets_path = File.join(File.dirname(__FILE__), 'vendor/assets')
21
+ tmp_path = File.join(File.dirname(__FILE__), 'tmp')
22
+
23
+ FileUtils.rm_rf(tmp_path) if File.exists?(tmp_path)
24
+ FileUtils.mkdir(tmp_path)
25
+
26
+ g = Git.clone(REPOSITORY, NAME, path: tmp_path)
27
+
28
+ abort 'Please provide a version' unless version = ENV['VERSION']
29
+
30
+ tag = 'v' + version
31
+
32
+ if tag
33
+ begin
34
+ tag = g.tag(tag)
35
+ rescue
36
+ abort "Tag '#{tag}' does not exist"
37
+ end
38
+ g.checkout(tag)
39
+ puts "Tag '#{tag.name}' imported"
40
+ else
41
+ puts 'Master branch imported'
42
+ end
43
+
44
+ # Copy files from tmp to vendor/assets
45
+ input_files.each_with_index do |input_file, index|
46
+ input_file = File.join(tmp_path, input_file)
47
+ output_file = File.join(assets_path, output_files[index])
48
+
49
+ # Create directory if not exists
50
+ FileUtils.mkdir_p(File.dirname(output_file))
51
+ FileUtils.cp(input_file, output_file)
52
+ end
53
+
54
+ # Update version
55
+ version_file = File.join(File.dirname(__FILE__), 'lib/bootstrap/datetimepicker/version.rb')
56
+ text = File.read(version_file).gsub!(/".*"/, "\"#{version}\"")
57
+ File.open(version_file, 'w') do |file|
58
+ file.write(text)
59
+ end
60
+ end
@@ -0,0 +1,22 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'bootstrap/datetimepicker/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "bootstrap-datetimepicker"
8
+ spec.version = Bootstrap::DateTimePicker::VERSION
9
+ spec.authors = ["Pierrick Rouxel"]
10
+ spec.summary = %q{Date/time picker widget for Twitter Bootstrap v3 (from Eonasdan)}
11
+ spec.homepage = "https://github.com/pierrickrouxel/bootstrap-datetimepicker"
12
+ spec.license = "MIT"
13
+
14
+ spec.files = `git ls-files -z`.split("\x0")
15
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
+ spec.require_paths = ["lib"]
18
+
19
+ spec.add_development_dependency "bundler", "~> 1.5"
20
+ spec.add_development_dependency "rake"
21
+ spec.add_development_dependency "git"
22
+ end
@@ -0,0 +1,44 @@
1
+ require "bootstrap/datetimepicker/version"
2
+
3
+ module Bootstrap
4
+ module DateTimePicker
5
+ class << self
6
+ def load!
7
+ register_rails_engine if rails?
8
+ end
9
+
10
+ # Paths
11
+ def gem_path
12
+ @gem_path ||= File.expand_path '..', File.dirname(__FILE__)
13
+ end
14
+
15
+ def assets_path
16
+ @assets_path ||= File.join gem_path, 'vendor', 'assets'
17
+ end
18
+
19
+ def stylesheets_path
20
+ File.join assets_path, 'stylesheets'
21
+ end
22
+
23
+ def javascripts_path
24
+ File.join assets_path, 'javascripts'
25
+ end
26
+
27
+ # Environment detection helpers
28
+ def asset_pipeline?
29
+ defined?(::Sprockets)
30
+ end
31
+
32
+ def rails?
33
+ defined?(::Rails)
34
+ end
35
+
36
+ private
37
+ def register_rails_engine
38
+ require 'bootstrap/datetimepicker/rails/engine' if ::Rails.version >= '3.1'
39
+ end
40
+ end
41
+ end
42
+ end
43
+
44
+ Bootstrap::DateTimePicker.load!
@@ -0,0 +1,6 @@
1
+ module Bootstrap
2
+ module DateTimePicker
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module Bootstrap
2
+ module DateTimePicker
3
+ VERSION = "2.1.30"
4
+ end
5
+ end
@@ -0,0 +1,28 @@
1
+ /**
2
+ * version 2.1.30
3
+ * @license
4
+ * =========================================================
5
+ * bootstrap-datetimepicker.js
6
+ * http://www.eyecon.ro/bootstrap-datepicker
7
+ * =========================================================
8
+ * Copyright 2012 Stefan Petre
9
+ *
10
+ * Contributions:
11
+ * - updated for Bootstrap v3 by Jonathan Peterson (@Eonasdan) and (almost)
12
+ * completely rewritten to use Momentjs
13
+ * - based on tarruda's bootstrap-datepicker
14
+ *
15
+ * Licensed under the Apache License, Version 2.0 (the "License");
16
+ * you may not use this file except in compliance with the License.
17
+ * You may obtain a copy of the License at
18
+ *
19
+ * http://www.apache.org/licenses/LICENSE-2.0
20
+ *
21
+ * Unless required by applicable law or agreed to in writing, software
22
+ * distributed under the License is distributed on an "AS IS" BASIS,
23
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24
+ * See the License for the specific language governing permissions and
25
+ * limitations under the License.
26
+ * =========================================================
27
+ */
28
+ (function(a){if(typeof define==="function"&&define.amd){define(["jquery","moment"],a)}else{if(!jQuery){throw"bootstrap-datetimepicker requires jQuery to be loaded first"}else{if(!moment){throw"bootstrap-datetimepicker requires moment.js to be loaded first"}else{a(jQuery,moment)}}}}(function(d,e){if(typeof e==="undefined"){alert("momentjs is requried");throw new Error("momentjs is required")}var c=0,a=e,b=function(o,q){var z={pickDate:true,pickTime:true,useMinutes:true,useSeconds:false,minuteStepping:1,startDate:new a({y:1970}),endDate:new a().add(50,"y"),collapse:true,language:a.lang(),defaultDate:"",disabledDates:[],enabledDates:false,icons:{},useStrict:false,direction:"auto"},M={time:"glyphicon glyphicon-time",date:"glyphicon glyphicon-calendar",up:"glyphicon glyphicon-chevron-up",down:"glyphicon glyphicon-chevron-down"},l=this,I=function(){var S=false,R,T,Q;l.options=d.extend({},z,q);l.options.icons=d.extend({},M,l.options.icons);l.element=d(o);f();if(!(l.options.pickTime||l.options.pickDate)){throw new Error("Must choose at least one picker")}l.id=c++;a.lang(l.options.language);l.date=a();l.unset=false;l.isInput=l.element.is("input");l.component=false;if(l.element.hasClass("input-group")){if(l.element.find(".datepickerbutton").size()==0){l.component=l.element.find("[class^='input-group-']")}else{l.component=l.element.find(".datepickerbutton")}}l.format=l.options.format;Q=a()._lang._longDateFormat;if(!l.format){if(l.isInput){l.format=l.element.data("format")}else{l.format=l.element.find("input").data("format")}if(!l.format){l.format=(l.options.pickDate?Q.L:"");if(l.options.pickDate&&l.options.pickTime){l.format+=" "}l.format+=(l.options.pickTime?Q.LT:"");if(l.options.useSeconds){if(~Q.LT.indexOf(" A")){l.format=l.format.split(" A")[0]+":ss A"}else{l.format+=":ss"}}}}l.options.use24hours=l.format.toLowerCase().indexOf("a")<1;if(l.component){S=l.component.find("span")}if(l.options.pickTime){if(S){S.addClass(l.options.icons.time)}}if(l.options.pickDate){if(S){S.removeClass(l.options.icons.time);S.addClass(l.options.icons.date)}}l.widget=d(P(l.options.pickDate,l.options.pickTime,l.options.collapse)).appendTo("body");l.minViewMode=l.options.minViewMode||l.element.data("date-minviewmode")||0;if(typeof l.minViewMode==="string"){switch(l.minViewMode){case"months":l.minViewMode=1;break;case"years":l.minViewMode=2;break;default:l.minViewMode=0;break}}l.viewMode=l.options.viewMode||l.element.data("date-viewmode")||0;if(typeof l.viewMode==="string"){switch(l.viewMode){case"months":l.viewMode=1;break;case"years":l.viewMode=2;break;default:l.viewMode=0;break}}for(R=0;R<l.options.disabledDates.length;R++){T=l.options.disabledDates[R];T=a(T);if(!T.isValid()){T=a(l.options.startDate).subtract(1,"day")}l.options.disabledDates[R]=T.format("L")}for(R=0;R<l.options.enabledDates.length;R++){T=l.options.enabledDates[R];T=a(T);if(!T.isValid()){T=a(l.options.startDate).subtract(1,"day")}l.options.enabledDates[R]=T.format("L")}l.startViewMode=l.viewMode;l.setStartDate(l.options.startDate||l.element.data("date-startdate"));l.setEndDate(l.options.endDate||l.element.data("date-enddate"));H();u();v();t();h();y();g();J();if(l.options.defaultDate!==""){l.setValue(l.options.defaultDate)}},f=function(){var Q=l.element.data();if(Q.pickdate!==undefined){l.options.pickDate=Q.pickdate}if(Q.picktime!==undefined){l.options.pickTime=Q.picktime}if(Q.useminutes!==undefined){l.options.useMinutes=Q.useminutes}if(Q.useseconds!==undefined){l.options.useSeconds=Q.useseconds}if(Q.minutestepping!==undefined){l.options.minuteStepping=Q.minutestepping}if(Q.startdate!==undefined){l.options.startDate=Q.startdate}if(Q.enddate!==undefined){l.options.endDate=Q.enddate}if(Q.collapse!==undefined){l.options.collapse=Q.collapse}if(Q.language!==undefined){l.options.language=Q.language}if(Q.defaultdate!==undefined){l.options.defaultDate=Q.defaultdate}if(Q.disableddates!==undefined){l.options.disabledDates=Q.disableddates}if(Q.enableddates!==undefined){l.options.enabledDates=Q.enableddates}if(Q.icons!==undefined){l.options.icons=Q.icons}if(Q.usestrict!==undefined){l.options.useStrict=Q.usestrict}},j=function(){var Q="absolute",S=l.component?l.component.offset():l.element.offset(),R=d(window);l.width=l.component?l.component.outerWidth():l.element.outerWidth();S.top=S.top+l.element.outerHeight();if(l.options.width!==undefined){l.widget.width(l.options.width)}if(l.options.orientation==="left"){l.widget.addClass("left-oriented");S.left=S.left-l.widget.width()+20}if(B()){Q="fixed";S.top-=R.scrollTop();S.left-=R.scrollLeft()}if(R.width()<S.left+l.widget.outerWidth()){S.right=R.width()-S.left-l.width;S.left="auto";l.widget.addClass("pull-right")}else{S.right="auto";l.widget.removeClass("pull-right")}l.widget.css({position:Q,top:S.top,left:S.left,right:S.right})},p=function(R,Q){l.element.trigger({type:"change.dp",date:a(l.date),oldDate:a(R)});if(Q!=="change"){l.element.change()}},C=function(Q){l.element.trigger({type:"error.dp",date:a(Q)})},y=function(Q){a.lang(l.options.language);var R=Q;if(!R){if(l.isInput){R=l.element.val()}else{R=l.element.find("input").val()}if(R){l.date=a(R,l.format,l.options.useStrict)}if(!l.date){l.date=a()}}l.viewDate=a(l.date).startOf("month");n();k()},H=function(){a.lang(l.options.language);var S=d("<tr>"),Q=a.weekdaysMin(),R;if(a()._lang._week.dow==0){for(R=0;R<7;R++){S.append('<th class="dow">'+Q[R]+"</th>")}}else{for(R=1;R<8;R++){if(R==7){S.append('<th class="dow">'+Q[0]+"</th>")}else{S.append('<th class="dow">'+Q[R]+"</th>")}}}l.widget.find(".datepicker-days thead").append(S)},u=function(){a.lang(l.options.language);var R="",Q=0,S=a.monthsShort();while(Q<12){R+='<span class="month">'+S[Q++]+"</span>"}l.widget.find(".datepicker-months td").append(R)},n=function(){a.lang(l.options.language);var ab=l.viewDate.year(),Z=l.viewDate.month(),aa=l.options.startDate.year(),ad=l.options.startDate.month(),ae=l.options.endDate.year(),X=l.options.endDate.month(),T,W,V=[],af,S,U,ac,R,Y,Q=a.months();l.widget.find(".datepicker-days").find(".disabled").removeClass("disabled");l.widget.find(".datepicker-months").find(".disabled").removeClass("disabled");l.widget.find(".datepicker-years").find(".disabled").removeClass("disabled");l.widget.find(".datepicker-days th:eq(1)").text(Q[Z]+" "+ab);T=a(l.viewDate).subtract("months",1);ac=T.daysInMonth();T.date(ac).startOf("week");if((ab==aa&&Z<=ad)||ab<aa){l.widget.find(".datepicker-days th:eq(0)").addClass("disabled")}if((ab==ae&&Z>=X)||ab>ae){l.widget.find(".datepicker-days th:eq(2)").addClass("disabled")}W=a(T).add(42,"d");while(T.isBefore(W)){if(T.weekday()===a().startOf("week").weekday()){af=d("<tr>");V.push(af)}S="";if(T.year()<ab||(T.year()==ab&&T.month()<Z)){S+=" old"}else{if(T.year()>ab||(T.year()==ab&&T.month()>Z)){S+=" new"}}if(T.isSame(a({y:l.date.year(),M:l.date.month(),d:l.date.date()}))){S+=" active"}if(O(T)||!s(T)){S+=" disabled"}af.append('<td class="day'+S+'">'+T.date()+"</td>");T.add(1,"d")}l.widget.find(".datepicker-days tbody").empty().append(V);Y=a().year(),Q=l.widget.find(".datepicker-months").find("th:eq(1)").text(ab).end().find("span").removeClass("active");if(Y===ab){Q.eq(a().month()).addClass("active")}if(Y-1<aa){l.widget.find(".datepicker-months th:eq(0)").addClass("disabled")}if(Y+1>ae){l.widget.find(".datepicker-months th:eq(2)").addClass("disabled")}for(U=0;U<12;U++){if((ab==aa&&ad>U)||(ab<aa)){d(Q[U]).addClass("disabled")}else{if((ab==ae&&X<U)||(ab>ae)){d(Q[U]).addClass("disabled")}}}V="";ab=parseInt(ab/10,10)*10;R=l.widget.find(".datepicker-years").find("th:eq(1)").text(ab+"-"+(ab+9)).end().find("td");l.widget.find(".datepicker-years").find("th").removeClass("disabled");if(aa>ab){l.widget.find(".datepicker-years").find("th:eq(0)").addClass("disabled")}if(ae<ab+9){l.widget.find(".datepicker-years").find("th:eq(2)").addClass("disabled")}ab-=1;for(U=-1;U<11;U++){V+='<span class="year'+(U===-1||U===10?" old":"")+(Y===ab?" active":"")+((ab<aa||ab>ae)?" disabled":"")+'">'+ab+"</span>";ab+=1}R.html(V)},v=function(){a.lang(l.options.language);var T=l.widget.find(".timepicker .timepicker-hours table"),S="",U,R,Q;T.parent().hide();if(l.options.use24hours){U=0;for(R=0;R<6;R+=1){S+="<tr>";for(Q=0;Q<4;Q+=1){S+='<td class="hour">'+N(U.toString())+"</td>";U++}S+="</tr>"}}else{U=1;for(R=0;R<3;R+=1){S+="<tr>";for(Q=0;Q<4;Q+=1){S+='<td class="hour">'+N(U.toString())+"</td>";U++}S+="</tr>"}}T.html(S)},t=function(){var T=l.widget.find(".timepicker .timepicker-minutes table"),S="",U=0,R,Q;T.parent().hide();for(R=0;R<5;R++){S+="<tr>";for(Q=0;Q<4;Q+=1){S+='<td class="minute">'+N(U.toString())+"</td>";U+=3}S+="</tr>"}T.html(S)},h=function(){var T=l.widget.find(".timepicker .timepicker-seconds table"),S="",U=0,R,Q;T.parent().hide();for(R=0;R<5;R++){S+="<tr>";for(Q=0;Q<4;Q+=1){S+='<td class="second">'+N(U.toString())+"</td>";U+=3}S+="</tr>"}T.html(S)},k=function(){if(!l.date){return}var S=l.widget.find(".timepicker span[data-time-component]"),Q=l.date.hours(),R="AM";if(!l.options.use24hours){if(Q>=12){R="PM"}if(Q===0){Q=12}else{if(Q!=12){Q=Q%12}}l.widget.find(".timepicker [data-action=togglePeriod]").text(R)}S.filter("[data-time-component=hours]").text(N(Q));S.filter("[data-time-component=minutes]").text(N(l.date.minutes()));S.filter("[data-time-component=seconds]").text(N(l.date.second()))},A=function(W){W.stopPropagation();W.preventDefault();l.unset=false;var V=d(W.target).closest("span, td, th"),U,S,T,Q,R=a(l.date);if(V.length===1){if(!V.is(".disabled")){switch(V[0].nodeName.toLowerCase()){case"th":switch(V[0].className){case"switch":g(1);break;case"prev":case"next":T=w.modes[l.viewMode].navStep;if(V[0].className==="prev"){T=T*-1}l.viewDate.add(T,w.modes[l.viewMode].navFnc);n();break}break;case"span":if(V.is(".month")){U=V.parent().find("span").index(V);l.viewDate.month(U)}else{S=parseInt(V.text(),10)||0;l.viewDate.year(S)}if(l.viewMode!==0){l.date=a({y:l.viewDate.year(),M:l.viewDate.month(),d:l.viewDate.date(),h:l.date.hours(),m:l.date.minutes()});p(R,W.type)}g(-1);n();break;case"td":if(V.is(".day")){Q=parseInt(V.text(),10)||1;U=l.viewDate.month();S=l.viewDate.year();if(V.is(".old")){if(U===0){U=11;S-=1}else{U-=1}}else{if(V.is(".new")){if(U==11){U=0;S+=1}else{U+=1}}}l.date=a({y:S,M:U,d:Q,h:l.date.hours(),m:l.date.minutes()});l.viewDate=a({y:S,M:U,d:Math.min(28,Q)});n();r();p(R,W.type)}break}}}},D={incrementHours:function(){m("add","hours",1)},incrementMinutes:function(){m("add","minutes",l.options.minuteStepping)},incrementSeconds:function(){m("add","seconds",1)},decrementHours:function(){m("subtract","hours",1)},decrementMinutes:function(){m("subtract","minutes",l.options.minuteStepping)},decrementSeconds:function(){m("subtract","seconds",1)},togglePeriod:function(){var Q=l.date.hours();if(Q>=12){Q-=12}else{Q+=12}l.date.hours(Q)},showPicker:function(){l.widget.find(".timepicker > div:not(.timepicker-picker)").hide();l.widget.find(".timepicker .timepicker-picker").show()},showHours:function(){l.widget.find(".timepicker .timepicker-picker").hide();l.widget.find(".timepicker .timepicker-hours").show()},showMinutes:function(){l.widget.find(".timepicker .timepicker-picker").hide();l.widget.find(".timepicker .timepicker-minutes").show()},showSeconds:function(){l.widget.find(".timepicker .timepicker-picker").hide();l.widget.find(".timepicker .timepicker-seconds").show()},selectHour:function(Q){l.date.hours(parseInt(d(Q.target).text(),10));D.showPicker.call(l)},selectMinute:function(Q){l.date.minutes(parseInt(d(Q.target).text(),10));D.showPicker.call(l)},selectSecond:function(Q){l.date.seconds(parseInt(d(Q.target).text(),10));D.showPicker.call(l)}},x=function(S){var Q=a(l.date),R=d(S.currentTarget).data("action"),T=D[R].apply(l,arguments);K(S);if(!l.date){l.date=a({y:1970})}r();k();p(Q,S.type);return T},K=function(Q){Q.stopPropagation();Q.preventDefault()},i=function(T){a.lang(l.options.language);var R=d(T.target),S=a(l.date),Q=a(R.val(),l.format,l.options.useStrict);if(Q.isValid()&&!O(Q)&&s(Q)){y();l.setValue(Q);p(S,T.type);r()}else{l.viewDate=S;R.val(a(S).format(l.format));p(S,T.type);C(Q);l.unset=true}},g=function(Q){if(Q){l.viewMode=Math.max(l.minViewMode,Math.min(2,l.viewMode+Q))}l.widget.find(".datepicker > div").hide().filter(".datepicker-"+w.modes[l.viewMode].clsName).show()},J=function(){var U,T,R,Q,S;l.widget.on("click",".datepicker *",d.proxy(A,this));l.widget.on("click","[data-action]",d.proxy(x,this));l.widget.on("mousedown",d.proxy(K,this));if(l.options.pickDate&&l.options.pickTime){l.widget.on("click.togglePicker",".accordion-toggle",function(V){V.stopPropagation();U=d(this);T=U.closest("ul");R=T.find(".in");Q=T.find(".collapse:not(.in)");if(R&&R.length){S=R.data("collapse");if(S&&S.transitioning){return}R.collapse("hide");Q.collapse("show");U.find("span").toggleClass(l.options.icons.time+" "+l.options.icons.date);l.element.find(".input-group-addon span").toggleClass(l.options.icons.time+" "+l.options.icons.date)}})}if(l.isInput){l.element.on({focus:d.proxy(l.show,this),change:d.proxy(i,this),blur:d.proxy(l.hide,this)})}else{l.element.on({change:d.proxy(i,this)},"input");if(l.component){l.component.on("click",d.proxy(l.show,this))}else{l.element.on("click",d.proxy(l.show,this))}}},L=function(){d(window).on("resize.datetimepicker"+l.id,d.proxy(j,this));if(!l.isInput){d(document).on("mousedown.datetimepicker"+l.id,d.proxy(l.hide,this))}},F=function(){l.widget.off("click",".datepicker *",l.click);l.widget.off("click","[data-action]");l.widget.off("mousedown",l.stopEvent);if(l.options.pickDate&&l.options.pickTime){l.widget.off("click.togglePicker")}if(l.isInput){l.element.off({focus:l.show,change:l.change})}else{l.element.off({change:l.change},"input");if(l.component){l.component.off("click",l.show)}else{l.element.off("click",l.show)}}},E=function(){d(window).off("resize.datetimepicker"+l.id);if(!l.isInput){d(document).off("mousedown.datetimepicker"+l.id)}},B=function(){if(l.element){var R=l.element.parents(),Q=false,S;for(S=0;S<R.length;S++){if(d(R[S]).css("position")=="fixed"){Q=true;break}}return Q}else{return false}},r=function(){a.lang(l.options.language);var R="",Q;if(!l.unset){R=a(l.date).format(l.format)}if(!l.isInput){if(l.component){Q=l.element.find("input");Q.val(R)}l.element.data("date",R)}else{l.element.val(R)}if(!l.options.pickTime){l.hide()}},m=function(T,S,R){a.lang(l.options.language);var Q;if(T=="add"){Q=a(l.date);if(Q.hours()==23){Q.add(R,S)}Q.add(R,S)}else{Q=a(l.date).subtract(R,S)}if(O(a(Q.subtract(R,S)))||O(Q)){C(Q.format(l.format));return}if(T=="add"){l.date.add(R,S)}else{l.date.subtract(R,S)}l.unset=false},O=function(Q){a.lang(l.options.language);if(Q.isAfter(l.options.endDate)||Q.isBefore(l.options.startDate)){return true}var S=l.options.disabledDates,R;for(R in S){if(S[R]==a(Q).format("L")){return true}}return false},s=function(R){a.lang(l.options.language);var Q=l.options.enabledDates,S;if(Q.length){for(S in Q){if(Q[S]==a(R).format("L")){return true}}return false}return Q===false?true:false},N=function(Q){Q=Q.toString();if(Q.length>=2){return Q}else{return"0"+Q}},P=function(R,Q,S){if(R&&Q){return('<div class="bootstrap-datetimepicker-widget dropdown-menu" style="z-index:9999 !important;"><ul class="list-unstyled"><li'+(S?' class="collapse in"':"")+'><div class="datepicker">'+w.template+'</div></li><li class="picker-switch accordion-toggle"><a class="btn" style="width:100%"><span class="'+l.options.icons.time+'"></span></a></li><li'+(S?' class="collapse"':"")+'><div class="timepicker">'+G.getTemplate()+"</div></li></ul></div>")}else{if(Q){return('<div class="bootstrap-datetimepicker-widget dropdown-menu"><div class="timepicker">'+G.getTemplate()+"</div></div>")}else{return('<div class="bootstrap-datetimepicker-widget dropdown-menu"><div class="datepicker">'+w.template+"</div></div>")}}},w={modes:[{clsName:"days",navFnc:"month",navStep:1},{clsName:"months",navFnc:"year",navStep:1},{clsName:"years",navFnc:"year",navStep:10}],headTemplate:'<thead><tr><th class="prev">&lsaquo;</th><th colspan="5" class="switch"></th><th class="next">&rsaquo;</th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>'},G={hourTemplate:'<span data-action="showHours" data-time-component="hours" class="timepicker-hour"></span>',minuteTemplate:'<span data-action="showMinutes" data-time-component="minutes" class="timepicker-minute"></span>',secondTemplate:'<span data-action="showSeconds" data-time-component="seconds" class="timepicker-second"></span>'};w.template='<div class="datepicker-days"><table class="table-condensed">'+w.headTemplate+'<tbody></tbody></table></div><div class="datepicker-months"><table class="table-condensed">'+w.headTemplate+w.contTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+w.headTemplate+w.contTemplate+"</table></div>";G.getTemplate=function(){return('<div class="timepicker-picker"><table class="table-condensed"><tr><td><a href="#" class="btn" data-action="incrementHours"><span class="'+l.options.icons.up+'"></span></a></td><td class="separator"></td><td>'+(l.options.useMinutes?'<a href="#" class="btn" data-action="incrementMinutes"><span class="'+l.options.icons.up+'"></span></a>':"")+"</td>"+(l.options.useSeconds?'<td class="separator"></td><td><a href="#" class="btn" data-action="incrementSeconds"><span class="'+l.options.icons.up+'"></span></a></td>':"")+(l.options.use24hours?"":'<td class="separator"></td>')+"</tr><tr><td>"+G.hourTemplate+'</td> <td class="separator">:</td><td>'+(l.options.useMinutes?G.minuteTemplate:'<span class="timepicker-minute">00</span>')+"</td> "+(l.options.useSeconds?'<td class="separator">:</td><td>'+G.secondTemplate+"</td>":"")+(l.options.use24hours?"":'<td class="separator"></td><td><button type="button" class="btn btn-primary" data-action="togglePeriod"></button></td>')+'</tr><tr><td><a href="#" class="btn" data-action="decrementHours"><span class="'+l.options.icons.down+'"></span></a></td><td class="separator"></td><td>'+(l.options.useMinutes?'<a href="#" class="btn" data-action="decrementMinutes"><span class="'+l.options.icons.down+'"></span></a>':"")+"</td>"+(l.options.useSeconds?'<td class="separator"></td><td><a href="#" class="btn" data-action="decrementSeconds"><span class="'+l.options.icons.down+'"></span></a></td>':"")+(l.options.use24hours?"":'<td class="separator"></td>')+'</tr></table></div><div class="timepicker-hours" data-action="selectHour"><table class="table-condensed"></table></div><div class="timepicker-minutes" data-action="selectMinute"><table class="table-condensed"></table></div>'+(l.options.useSeconds?'<div class="timepicker-seconds" data-action="selectSecond"><table class="table-condensed"></table></div>':""))};l.destroy=function(){F();E();l.widget.remove();l.element.removeData("DateTimePicker");if(l.component){l.component.removeData("DateTimePicker")}};l.show=function(Q){l.widget.show();l.height=l.component?l.component.outerHeight():l.element.outerHeight();j();l.element.trigger({type:"show.dp",date:a(l.date)});L();if(Q){K(Q)}},l.disable=function(){var Q=l.element.find("input");if(Q.prop("disabled")){return}Q.prop("disabled",true);F()},l.enable=function(){var Q=l.element.find("input");if(!Q.prop("disabled")){return}Q.prop("disabled",false);J()},l.hide=function(S){if(S&&d(S.target).is(l.element.attr("id"))){return}var T=l.widget.find(".collapse"),Q,R;for(Q=0;Q<T.length;Q++){R=T.eq(Q).data("collapse");if(R&&R.transitioning){return}}l.widget.hide();l.viewMode=l.startViewMode;g();l.element.trigger({type:"hide.dp",date:a(l.date)});E()},l.setValue=function(Q){a.lang(l.options.language);if(!Q){l.unset=true}else{l.unset=false}if(!a.isMoment(Q)){Q=a(Q)}if(Q.isValid()){l.date=Q;r();l.viewDate=a({y:l.date.year(),M:l.date.month()});n();k()}else{C(Q)}},l.getDate=function(){if(l.unset){return null}return l.date},l.setDate=function(Q){Q=a(Q);if(!Q){l.setValue(null)}else{l.setValue(Q)}},l.setEnabledDates=function(Q){if(!Q){l.options.enabledDates=false}else{l.options.enabledDates=Q}if(l.viewDate){y()}},l.setEndDate=function(Q){if(Q==undefined){return}l.options.endDate=a(Q);if(l.viewDate){y()}},l.setStartDate=function(Q){if(Q==undefined){return}l.options.startDate=a(Q);if(l.viewDate){y()}};I()};d.fn.datetimepicker=function(f){return this.each(function(){var h=d(this),g=h.data("DateTimePicker");if(!g){h.data("DateTimePicker",new b(this,f))}})}}));
@@ -0,0 +1,174 @@
1
+ /**
2
+ * Build file for the dist version of datetimepicker.css
3
+ */
4
+ /*!
5
+ * Datetimepicker for Bootstrap v3
6
+ * https://github.com/Eonasdan/bootstrap-datetimepicker/
7
+ * Copyright 2012 Stefan Petre
8
+ * Licensed under the Apache License v2.0
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ */
12
+ .bootstrap-datetimepicker-widget {
13
+ top: 0;
14
+ left: 0;
15
+ width: 250px;
16
+ padding: 4px;
17
+ margin-top: 1px;
18
+ z-index: 99999;
19
+ border-radius: 4px;
20
+ /*.dow {
21
+ border-top: 1px solid #ddd !important;
22
+ }*/
23
+ }
24
+ .bootstrap-datetimepicker-widget .btn {
25
+ padding: 6px;
26
+ }
27
+ .bootstrap-datetimepicker-widget:before {
28
+ content: '';
29
+ display: inline-block;
30
+ border-left: 7px solid transparent;
31
+ border-right: 7px solid transparent;
32
+ border-bottom: 7px solid #ccc;
33
+ border-bottom-color: rgba(0, 0, 0, 0.2);
34
+ position: absolute;
35
+ top: -7px;
36
+ left: 6px;
37
+ }
38
+ .bootstrap-datetimepicker-widget:after {
39
+ content: '';
40
+ display: inline-block;
41
+ border-left: 6px solid transparent;
42
+ border-right: 6px solid transparent;
43
+ border-bottom: 6px solid white;
44
+ position: absolute;
45
+ top: -6px;
46
+ left: 7px;
47
+ }
48
+ .bootstrap-datetimepicker-widget.pull-right:before {
49
+ left: auto;
50
+ right: 6px;
51
+ }
52
+ .bootstrap-datetimepicker-widget.pull-right:after {
53
+ left: auto;
54
+ right: 7px;
55
+ }
56
+ .bootstrap-datetimepicker-widget > ul {
57
+ list-style-type: none;
58
+ margin: 0;
59
+ }
60
+ .bootstrap-datetimepicker-widget .timepicker-hour,
61
+ .bootstrap-datetimepicker-widget .timepicker-minute,
62
+ .bootstrap-datetimepicker-widget .timepicker-second {
63
+ width: 100%;
64
+ font-weight: bold;
65
+ font-size: 1.2em;
66
+ }
67
+ .bootstrap-datetimepicker-widget table[data-hour-format="12"] .separator {
68
+ width: 4px;
69
+ padding: 0;
70
+ margin: 0;
71
+ }
72
+ .bootstrap-datetimepicker-widget .datepicker > div {
73
+ display: none;
74
+ }
75
+ .bootstrap-datetimepicker-widget .picker-switch {
76
+ text-align: center;
77
+ }
78
+ .bootstrap-datetimepicker-widget table {
79
+ width: 100%;
80
+ margin: 0;
81
+ }
82
+ .bootstrap-datetimepicker-widget td,
83
+ .bootstrap-datetimepicker-widget th {
84
+ text-align: center;
85
+ width: 20px;
86
+ height: 20px;
87
+ border-radius: 4px;
88
+ }
89
+ .bootstrap-datetimepicker-widget td.day:hover,
90
+ .bootstrap-datetimepicker-widget td.hour:hover,
91
+ .bootstrap-datetimepicker-widget td.minute:hover,
92
+ .bootstrap-datetimepicker-widget td.second:hover {
93
+ background: #eeeeee;
94
+ cursor: pointer;
95
+ }
96
+ .bootstrap-datetimepicker-widget td.old,
97
+ .bootstrap-datetimepicker-widget td.new {
98
+ color: #999999;
99
+ }
100
+ .bootstrap-datetimepicker-widget td.active,
101
+ .bootstrap-datetimepicker-widget td.active:hover {
102
+ background-color: #428bca;
103
+ color: #fff;
104
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
105
+ }
106
+ .bootstrap-datetimepicker-widget td.disabled,
107
+ .bootstrap-datetimepicker-widget td.disabled:hover {
108
+ background: none;
109
+ color: #999999;
110
+ cursor: not-allowed;
111
+ }
112
+ .bootstrap-datetimepicker-widget td span {
113
+ display: block;
114
+ width: 47px;
115
+ height: 54px;
116
+ line-height: 54px;
117
+ float: left;
118
+ margin: 2px;
119
+ cursor: pointer;
120
+ border-radius: 4px;
121
+ }
122
+ .bootstrap-datetimepicker-widget td span:hover {
123
+ background: #eeeeee;
124
+ }
125
+ .bootstrap-datetimepicker-widget td span.active {
126
+ background-color: #428bca;
127
+ color: #fff;
128
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
129
+ }
130
+ .bootstrap-datetimepicker-widget td span.old {
131
+ color: #999999;
132
+ }
133
+ .bootstrap-datetimepicker-widget td span.disabled,
134
+ .bootstrap-datetimepicker-widget td span.disabled:hover {
135
+ background: none;
136
+ color: #999999;
137
+ cursor: not-allowed;
138
+ }
139
+ .bootstrap-datetimepicker-widget th.switch {
140
+ width: 145px;
141
+ }
142
+ .bootstrap-datetimepicker-widget th.next,
143
+ .bootstrap-datetimepicker-widget th.prev {
144
+ font-size: 21px;
145
+ }
146
+ .bootstrap-datetimepicker-widget th.disabled,
147
+ .bootstrap-datetimepicker-widget th.disabled:hover {
148
+ background: none;
149
+ color: #999999;
150
+ cursor: not-allowed;
151
+ }
152
+ .bootstrap-datetimepicker-widget thead tr:first-child th {
153
+ cursor: pointer;
154
+ }
155
+ .bootstrap-datetimepicker-widget thead tr:first-child th:hover {
156
+ background: #eeeeee;
157
+ }
158
+ .input-group.date .input-group-addon span {
159
+ display: block;
160
+ cursor: pointer;
161
+ width: 16px;
162
+ height: 16px;
163
+ }
164
+ .bootstrap-datetimepicker-widget.left-oriented:before {
165
+ left: auto;
166
+ right: 6px;
167
+ }
168
+ .bootstrap-datetimepicker-widget.left-oriented:after {
169
+ left: auto;
170
+ right: 7px;
171
+ }
172
+ .bootstrap-datetimepicker-widget ul.list-unstyled li.in div.timepicker div.timepicker-picker table.table-condensed tbody > tr > td {
173
+ padding: 0px !important;
174
+ }
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bootstrap-datetimepicker
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.1.30
5
+ platform: ruby
6
+ authors:
7
+ - Pierrick Rouxel
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-01-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: git
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description:
56
+ email:
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - .gitignore
62
+ - Gemfile
63
+ - LICENSE.txt
64
+ - README.md
65
+ - Rakefile
66
+ - bootstrap-datetimepicker.gemspec
67
+ - lib/bootstrap/datetimepicker.rb
68
+ - lib/bootstrap/datetimepicker/rails/engine.rb
69
+ - lib/bootstrap/datetimepicker/version.rb
70
+ - vendor/assets/javascripts/bootstrap-datetimepicker.js
71
+ - vendor/assets/stylesheets/bootstrap-datetimepicker.css
72
+ homepage: https://github.com/pierrickrouxel/bootstrap-datetimepicker
73
+ licenses:
74
+ - MIT
75
+ metadata: {}
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubyforge_project:
92
+ rubygems_version: 2.0.14
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: Date/time picker widget for Twitter Bootstrap v3 (from Eonasdan)
96
+ test_files: []