Skip to content

Commit 750d026

Browse files
committed
0876
1 parent 01a611a commit 750d026

4 files changed

Lines changed: 31 additions & 6 deletions

File tree

Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,9 @@ end
7373
gem 'bootstrap', '~> 4.0.0.alpha6'
7474
gem 'jquery-rails'
7575
gem 'font-awesome-sass', '~> 4.7.0'
76+
77+
78+
gem 'momentjs-rails'
79+
gem 'bootstrap3-datetimepicker-rails'
80+
gem 'chronic'
81+

Gemfile.lock

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
GIT
22
remote: https://github.com/firstdraft/grade_runner.git
3-
revision: dabf435a51bb4742f4c5b863d9f232c34f85ba87
3+
revision: 83db5d2b90086055aa3204afe38a18394aecea16
44
specs:
55
grade_runner (0.0.1)
66

@@ -62,7 +62,7 @@ GEM
6262
activerecord (>= 3.2, < 6.0)
6363
rake (>= 10.4, < 13.0)
6464
arel (8.0.0)
65-
autoprefixer-rails (7.1.2.1)
65+
autoprefixer-rails (7.1.2.2)
6666
execjs
6767
awesome_print (1.8.0)
6868
better_errors (2.1.1)
@@ -75,6 +75,8 @@ GEM
7575
bootstrap (4.0.0.alpha6)
7676
autoprefixer-rails (>= 6.0.3)
7777
sass (>= 3.4.19)
78+
bootstrap3-datetimepicker-rails (4.17.47)
79+
momentjs-rails (>= 2.8.1)
7880
builder (3.2.3)
7981
byebug (9.0.6)
8082
callsite (0.0.11)
@@ -85,6 +87,7 @@ GEM
8587
rack (>= 1.0.0)
8688
rack-test (>= 0.5.4)
8789
xpath (~> 2.0)
90+
chronic (0.10.2)
8891
coderay (1.1.1)
8992
concurrent-ruby (1.0.5)
9093
crack (0.4.3)
@@ -110,7 +113,7 @@ GEM
110113
globalid (0.4.0)
111114
activesupport (>= 4.2.0)
112115
hashdiff (0.3.4)
113-
i18n (0.8.5)
116+
i18n (0.8.6)
114117
jbuilder (2.7.0)
115118
activesupport (>= 4.2.0)
116119
multi_json (>= 1.2)
@@ -140,6 +143,8 @@ GEM
140143
mime-types-data (3.2016.0521)
141144
mini_portile2 (2.2.0)
142145
minitest (5.10.2)
146+
momentjs-rails (2.17.1)
147+
railties (>= 3.1)
143148
multi_json (1.12.1)
144149
nio4r (2.1.0)
145150
nokogiri (1.8.0)
@@ -262,8 +267,10 @@ DEPENDENCIES
262267
better_errors
263268
binding_of_caller
264269
bootstrap (~> 4.0.0.alpha6)
270+
bootstrap3-datetimepicker-rails
265271
byebug
266272
capybara
273+
chronic
267274
dotenv-rails
268275
factory_girl_rails
269276
firstdraft_generators
@@ -274,6 +281,7 @@ DEPENDENCIES
274281
letter_opener
275282
listen (>= 3.0.5, < 3.2)
276283
meta_request
284+
momentjs-rails
277285
pry-rails
278286
puma (~> 3.7)
279287
rails (~> 5.1.2)

app/assets/javascripts/application.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@
1111
// about supported directives.
1212
//
1313
//= require rails-ujs
14+
//= require jquery
1415
//= require bootstrap
1516
//= require turbolinks
1617
//= require_tree .
18+
19+
20+
/= require moment
21+
//= require bootstrap-datetimepicker
22+
23+
$(function () {
24+
$('.datetimepicker').datetimepicker();
25+
});

app/controllers/calculations_controller.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def word_count
1111
# ================================================================================
1212

1313

14+
1415
@word_count = @text.split(" ").length
1516

1617
@character_count_with_spaces = @text.length
@@ -44,8 +45,8 @@ def loan_payment
4445
# The principal value the user input is in the decimal @principal.
4546
# ================================================================================
4647

47-
monthly_interest = (@apr/12)/100
48-
number_of_monthly_payments = @years*-12
48+
monthly_interest = (@apr/12)/100
49+
number_of_monthly_payments = @years*-12
4950

5051
@monthly_payment = @principal*(monthly_interest/(1-(1+monthly_interest)**number_of_monthly_payments))
5152

@@ -76,7 +77,6 @@ def time_between
7677
@weeks = @days/7
7778
@years = @weeks/52
7879

79-
8080
# ================================================================================
8181
# Your code goes above.
8282
# ================================================================================
@@ -86,6 +86,8 @@ def time_between
8686

8787
def descriptive_statistics
8888
@numbers = params[:list_of_numbers].gsub(',', '').split.map(&:to_f)
89+
90+
8991

9092
# ================================================================================
9193
# Your code goes below.

0 commit comments

Comments
 (0)