killbill-assets-ui 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93888d06af7955b7384f910530aae1da21897fc0ae2d127974ea2643ed0363b7
4
- data.tar.gz: 9d0aed469ed482c8ead4a60fbf4be10316b8620d29cdf5c15502ba488e1a9f0d
3
+ metadata.gz: e6b103ad8caaa97fd2a37d3fe13dc05d12ff84f7e5b6890d15eb07d8f3a06bdd
4
+ data.tar.gz: ae8555c822e5c4f9b2b7c5bc9946e4103ff94afe96d45c7f0879f3e06f95bfc9
5
5
  SHA512:
6
- metadata.gz: ae318cb25844c908a7ce6a4d5f002d48d860ac8ef263291e587d1ce281284b0a6d003f14060c729ab9c8818b53f6ac91f1fd7c550542aad1a208e8adf3e3b883
7
- data.tar.gz: b5beaea1c79aaad3e0056e5d6fb12fc2652beb4385aa7f0e55851521f8793fea023dc6322859b931d5f5bbf288852e82d4ee7157425052ffde3e2491e4afa5b7
6
+ metadata.gz: 32c0b564c20930b6525b45d3e432b6829c03512320acc8a609cf8387d899c525696834fb9537b881cf545160a88393c8e8fbea805968498f87f41107d37274b4
7
+ data.tar.gz: 78d6149795845f0d5a1877e8eaff3895fe37cfbd58954b8294ae46354a5df9c951cee69bc937ccc12701308c5b1ea7d17281408cbf0c4869abe513872b02302d
@@ -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.5'
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.5
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-04-10 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: []