killbill-assets-ui 0.1.3 → 0.1.4

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
  SHA256:
3
- metadata.gz: 93888d06af7955b7384f910530aae1da21897fc0ae2d127974ea2643ed0363b7
4
- data.tar.gz: 9d0aed469ed482c8ead4a60fbf4be10316b8620d29cdf5c15502ba488e1a9f0d
3
+ metadata.gz: 9dc1b50a983b8d5713cc19710f7c463c25acd374236ee0da597c2a4f2e0b4ba2
4
+ data.tar.gz: 807f5ce361a41c440d888ac999d76e878a20f2428ec5707f354c84f300174317
5
5
  SHA512:
6
- metadata.gz: ae318cb25844c908a7ce6a4d5f002d48d860ac8ef263291e587d1ce281284b0a6d003f14060c729ab9c8818b53f6ac91f1fd7c550542aad1a208e8adf3e3b883
7
- data.tar.gz: b5beaea1c79aaad3e0056e5d6fb12fc2652beb4385aa7f0e55851521f8793fea023dc6322859b931d5f5bbf288852e82d4ee7157425052ffde3e2491e4afa5b7
6
+ metadata.gz: b6b047b1849bf4077cde30e1dfd213e0515c549995b2b1029a7a85ce02b86310a7396fdfeb5ab38910072a660dcbe15fe443f6bcb1809ac7b6729d6d998bb321
7
+ data.tar.gz: f6b3cb91a9b6108587f42452b3099918d1c246858775662f8ba2f123dd7693b0dd58b72767693ea57e5f93577357ab8b6d7f00d2b7a62c4b087fc408c2075876
@@ -0,0 +1,34 @@
1
+ function setDateRange(option) {
2
+ var currentDate = new Date();
3
+ var startDate, endDate;
4
+
5
+ if (option === "day") {
6
+ startDate = new Date();
7
+ endDate = new Date();
8
+ endDate.setDate(endDate.getDate() + 1);
9
+ } else if (option === "week") {
10
+ startDate = new Date(currentDate.setDate(currentDate.getDate() - currentDate.getDay() + 1));
11
+ currentDate = new Date();
12
+ endDate = new Date(currentDate.setDate(currentDate.getDate() - currentDate.getDay() + 7));
13
+ } else if (option === "month") {
14
+ startDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1);
15
+ endDate = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0);
16
+ } else if (option === "year") {
17
+ startDate = new Date(currentDate.getFullYear(), 0, 1);
18
+ endDate = new Date(currentDate.getFullYear(), 11, 31);
19
+ }
20
+
21
+ var startDateFormatted = formatDate(startDate);
22
+ var endDateFormatted = formatDate(endDate);
23
+
24
+ $('#startDate').val(startDateFormatted);
25
+ $('#endDate').val(endDateFormatted);
26
+ $('#startDate, #endDate').prop('disabled', true);
27
+ }
28
+
29
+ function formatDate(date) {
30
+ var year = date.getFullYear();
31
+ var month = String(date.getMonth() + 1).padStart(2, '0');
32
+ var day = String(date.getDate()).padStart(2, '0');
33
+ return `${year}-${month}-${day}`;
34
+ }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Assets
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill-assets-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kill Bill core team
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-21 00:00:00.000000000 Z
11
+ date: 2025-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap-datepicker-rails
@@ -87,6 +87,7 @@ files:
87
87
  - app/assets/javascripts/assets/jquery-ui.min.js
88
88
  - app/assets/javascripts/assets/jquery.spin.js
89
89
  - app/assets/javascripts/assets/jquery_datatables.js
90
+ - app/assets/javascripts/assets/killbill_date_range.js
90
91
  - app/assets/javascripts/assets/spin.js
91
92
  - app/assets/stylesheets/application.css
92
93
  - app/assets/stylesheets/assets/bootstrap.css
@@ -105,7 +106,7 @@ licenses:
105
106
  - MIT
106
107
  metadata:
107
108
  rubygems_mfa_required: 'true'
108
- post_install_message:
109
+ post_install_message:
109
110
  rdoc_options: []
110
111
  require_paths:
111
112
  - lib
@@ -121,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
122
  version: '0'
122
123
  requirements: []
123
124
  rubygems_version: 3.4.10
124
- signing_key:
125
+ signing_key:
125
126
  specification_version: 4
126
127
  summary: Kill Bill Assets UI mountable engine
127
128
  test_files: []