Skip to content

Commit

Permalink
Merge pull request #634 from dbarzin/dev
Browse files Browse the repository at this point in the history
fix javascript
  • Loading branch information
dbarzin authored Feb 20, 2024
2 parents e6a8228 + 4bb01bc commit 60b00f7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions resources/views/admin/patching/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,11 @@
.on('dp.change', function (e) {
var frequency = $("#patching_frequency").find(':selected')[0].value;
if (frequency!=null) {
var d = new Date(e.date);
d.setMonth(d.getMonth() + frequency + 0 );
var parts = $('#update_date.datepicker').val().split("/");
var d = new Date(parseInt(parts[2], 10),
parseInt(parts[1], 10) - 1,
parseInt(parts[0], 10));
d.setMonth(d.getMonth()+parseInt(frequency));
$("#next_update").val(
(d.getDate()>9 ? d.getDate() : ('0' + d.getDate())) + '/' +
(d.getMonth()>8 ? (d.getMonth()+1) : ('0' + (d.getMonth()+1))) + '/' + d.getFullYear());
Expand Down

0 comments on commit 60b00f7

Please sign in to comment.