active_admin_datetimepicker 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +4 -0
- data/.travis.yml +14 -9
- data/Gemfile +7 -6
- data/README.md +27 -18
- data/active_admin_datetimepicker.gemspec +1 -4
- data/app/assets/stylesheets/active_admin_datetimepicker.scss +0 -2
- data/config/initializers/active_admin_datetimepicker.rb +3 -0
- data/lib/active_admin_datetimepicker/version.rb +1 -1
- data/tasks/test.rake +9 -2
- metadata +9 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: af9277c546f2709a463057a941c8184eae8dab952ece485b7b6aa709e095b619
|
4
|
+
data.tar.gz: f01707b1c65fd42426a9699ce5ce2ca8552f81be3b639d1a01ba2d950994e100
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f336b632f9d1b8f6f59369c61d1e8ddcc5e690cd0aff2e44af5a2d724d202bbe72ec4e8939bfbd426a33156b7be0628f1be77267500a200385d3def9dc650b4
|
7
|
+
data.tar.gz: daecd965d93394a5a3129cab26758e26c73a934221e65c5c5717febf805c220e53a7707a1e255b5c400c121435be815a16c383f2fb7d3135abe8d3902b958372
|
data/.gitignore
ADDED
data/.travis.yml
CHANGED
@@ -1,13 +1,18 @@
|
|
1
|
+
sudo: required
|
2
|
+
language: ruby
|
3
|
+
addons:
|
4
|
+
chrome: stable
|
5
|
+
|
6
|
+
before_install: gem install bundler -v 1.16.0.pre.3
|
7
|
+
|
1
8
|
script: bundle exec rspec spec
|
2
|
-
|
9
|
+
|
3
10
|
env:
|
4
11
|
matrix:
|
5
|
-
- RAILS=4.2.
|
6
|
-
- RAILS=5.
|
12
|
+
- RAILS=4.2.10 AA=1.1.0
|
13
|
+
- RAILS=5.1.0 AA=1.2.1
|
14
|
+
- RAILS=5.2.1 AA=1.3.1
|
7
15
|
rvm:
|
8
|
-
- 2.
|
9
|
-
- 2.
|
10
|
-
|
11
|
-
- gem update --system
|
12
|
-
- rvm @global do gem install bundler -v 1.14.6
|
13
|
-
- gem --version
|
16
|
+
- 2.3
|
17
|
+
- 2.4
|
18
|
+
- 2.5
|
data/Gemfile
CHANGED
@@ -3,12 +3,13 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in active_admin_datetimepicker.gemspec
|
4
4
|
gemspec
|
5
5
|
group :test do
|
6
|
-
default_rails_version = '
|
7
|
-
default_activeadmin_version = '1.1
|
8
|
-
|
9
|
-
gem 'rails', "#{ENV['RAILS'] || default_rails_version}"
|
6
|
+
default_rails_version = '5.2.1'
|
7
|
+
default_activeadmin_version = '1.3.1'
|
8
|
+
|
9
|
+
gem 'rails', "~> #{ENV['RAILS'] || default_rails_version}"
|
10
|
+
gem 'activeadmin', "~> #{ENV['AA'] || default_activeadmin_version}"
|
11
|
+
|
10
12
|
gem 'rspec-rails'
|
11
|
-
gem 'activeadmin', "#{ENV['AA'] || default_activeadmin_version}"
|
12
13
|
gem 'coveralls', require: false # Test coverage website. Go to https://coveralls.io
|
13
14
|
gem 'sass-rails'
|
14
15
|
gem 'sqlite3'
|
@@ -16,5 +17,5 @@ group :test do
|
|
16
17
|
gem 'database_cleaner'
|
17
18
|
gem 'capybara'
|
18
19
|
gem 'selenium-webdriver'
|
19
|
-
gem '
|
20
|
+
gem 'chromedriver-helper'
|
20
21
|
end
|
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/active_admin_datetimepicker.svg)](http://badge.fury.io/rb/active_admin_datetimepicker)
|
1
2
|
[![Build Status](https://img.shields.io/travis/activeadmin-plugins/active_admin_datetimepicker.svg)](https://travis-ci.org/activeadmin-plugins/active_admin_datetimepicker)
|
3
|
+
[![Coverage](https://coveralls.io/repos/activeadmin-plugins/active_admin_datetimepicker/badge.svg?branch=master)](https://coveralls.io/r/activeadmin-plugins/active_admin_datetimepicker)
|
2
4
|
|
3
5
|
# ActiveAdminDatetimepicker
|
4
6
|
|
5
|
-
Adds ability to use XDSoft's DateTime picker as the date_time_picker input for forms, and date_time_range for filters
|
7
|
+
Adds ability to use XDSoft's DateTime picker as the `date_time_picker` input for forms, and `date_time_range` for filters
|
6
8
|
|
7
9
|
|
8
10
|
![ActiveAdminDatetimepicker](https://raw.githubusercontent.com/ActiveAdminPlugins/activeadmin_datetimepicker/master/screen/screen.png "ActiveAdminDatetimepicker")
|
@@ -23,31 +25,37 @@ Or install it yourself as:
|
|
23
25
|
|
24
26
|
$ gem install active_admin_datetimepicker
|
25
27
|
|
26
|
-
|
28
|
+
Add following line into `app/assets/stylesheets/active_admin.css.scss`
|
27
29
|
|
28
|
-
|
29
|
-
|
30
|
+
```css
|
31
|
+
@import "active_admin_datetimepicker";
|
32
|
+
```
|
30
33
|
|
31
|
-
|
32
|
-
```//= require active_admin_datetimepicker```
|
34
|
+
Add following line into `app/assets/javascripts/active_admin.js.coffee`
|
33
35
|
|
34
|
-
|
35
|
-
|
36
|
+
```coffee
|
37
|
+
#= require active_admin_datetimepicker
|
38
|
+
```
|
36
39
|
|
37
40
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
end
|
43
|
-
```
|
41
|
+
## Usage
|
42
|
+
|
43
|
+
Plugin offers the `date_time_picker` input and `date_time_range` filter, which use the [XDSoft DateTime Picker gem](https://github.com/shekibobo/xdan-datetimepicker-rails).
|
44
|
+
The `date_time_picker` input accepts many of the options available to the standard jQueryUI Datepicker. For example:
|
44
45
|
|
45
46
|
```ruby
|
46
|
-
|
47
|
+
# Index page filters
|
48
|
+
filter :created_at, as: :date_time_range
|
49
|
+
|
50
|
+
# New/Edit form
|
51
|
+
form do |f|
|
52
|
+
f.input :starts_at, as: :date_time_picker, datepicker_options: { min_date: "2013-10-8", max_date: "+3D" }
|
53
|
+
f.input :ends_at, as: :date_time_picker, datepicker_options: { min_date: 3.days.ago.to_date, max_date: "+1W +5D" }
|
54
|
+
end
|
47
55
|
```
|
48
56
|
|
49
|
-
|
50
57
|
## Override behaviour in initializer
|
58
|
+
|
51
59
|
```ruby
|
52
60
|
# This if for front-end javascript side
|
53
61
|
ActiveAdminDatetimepicker::Base.default_datetime_picker_options = {
|
@@ -58,9 +66,10 @@ ActiveAdminDatetimepicker::Base.format = "%Y-%m-%d %H:%M:%S"
|
|
58
66
|
```
|
59
67
|
|
60
68
|
## Change datetime format
|
61
|
-
If you want to change format - you need to make sure that front-end and back-end formats are identical.
|
69
|
+
If you want to change format - you need to make sure that front-end and back-end formats are identical.
|
70
|
+
And remember JS and Ruby datetime format has different syntax.
|
62
71
|
|
63
|
-
Create configuration file
|
72
|
+
Create configuration file `/config/initializers/init_datetimpicker.rb`
|
64
73
|
|
65
74
|
```ruby
|
66
75
|
# Example "11/03/2016 13:00"
|
@@ -19,9 +19,6 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_dependency "xdan-datetimepicker-rails", "~> 2.5.1"
|
23
22
|
spec.add_dependency "activeadmin", "~> 1.1"
|
24
|
-
spec.
|
25
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
-
|
23
|
+
spec.add_dependency "xdan-datetimepicker-rails", "~> 2.5.4"
|
27
24
|
end
|
data/tasks/test.rake
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
desc "Creates a test rails app for the specs to run against"
|
2
2
|
task :setup do
|
3
3
|
require 'rails/version'
|
4
|
-
|
5
|
-
|
4
|
+
|
5
|
+
rails_new_opts = %w(
|
6
|
+
--skip-turbolinks
|
7
|
+
--skip-spring
|
8
|
+
--skip-bootsnap
|
9
|
+
-m
|
10
|
+
spec/support/rails_template.rb
|
11
|
+
)
|
12
|
+
system "bundle exec rails new spec/rails/rails-#{Rails::VERSION::STRING} #{rails_new_opts.join(' ')}"
|
6
13
|
end
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_admin_datetimepicker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Fedoronchuk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: xdan-datetimepicker-rails
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 2.5.1
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 2.5.1
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: activeadmin
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,33 +25,19 @@ dependencies:
|
|
39
25
|
- !ruby/object:Gem::Version
|
40
26
|
version: '1.1'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '1.8'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '1.8'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rake
|
28
|
+
name: xdan-datetimepicker-rails
|
57
29
|
requirement: !ruby/object:Gem::Requirement
|
58
30
|
requirements:
|
59
31
|
- - "~>"
|
60
32
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
62
|
-
type: :
|
33
|
+
version: 2.5.4
|
34
|
+
type: :runtime
|
63
35
|
prerelease: false
|
64
36
|
version_requirements: !ruby/object:Gem::Requirement
|
65
37
|
requirements:
|
66
38
|
- - "~>"
|
67
39
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
40
|
+
version: 2.5.4
|
69
41
|
description: Integrate jQuery xdan datetimepicker plugin to ActiveAdmin
|
70
42
|
email:
|
71
43
|
- fedoronchuk@gmail.com
|
@@ -73,6 +45,7 @@ executables: []
|
|
73
45
|
extensions: []
|
74
46
|
extra_rdoc_files: []
|
75
47
|
files:
|
48
|
+
- ".gitignore"
|
76
49
|
- ".travis.yml"
|
77
50
|
- CODE_OF_CONDUCT.md
|
78
51
|
- Gemfile
|
@@ -82,6 +55,7 @@ files:
|
|
82
55
|
- active_admin_datetimepicker.gemspec
|
83
56
|
- app/assets/javascripts/active_admin_datetimepicker.js.coffee
|
84
57
|
- app/assets/stylesheets/active_admin_datetimepicker.scss
|
58
|
+
- config/initializers/active_admin_datetimepicker.rb
|
85
59
|
- lib/active_admin_datetimepicker.rb
|
86
60
|
- lib/active_admin_datetimepicker/base.rb
|
87
61
|
- lib/active_admin_datetimepicker/inputs/date_time_picker_input.rb
|
@@ -109,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
83
|
version: '0'
|
110
84
|
requirements: []
|
111
85
|
rubyforge_project:
|
112
|
-
rubygems_version: 2.
|
86
|
+
rubygems_version: 2.7.7
|
113
87
|
signing_key:
|
114
88
|
specification_version: 4
|
115
89
|
summary: datetimepicker extension for ActiveAdmin
|