Skip to content

Commit

Permalink
33260 bug-fixing-trial
Browse files Browse the repository at this point in the history
  • Loading branch information
ofcom-ramakrishnan committed Jan 6, 2025
1 parent 8858b60 commit ddc0b7a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 54 deletions.
13 changes: 13 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -6782,6 +6782,19 @@ agendas-container agendas-item agendas-published {
height: 620px;
}
}
/* added for 33260 bug*/
@media all and (min-width: 0) and (max-width: 1024px) and (pointer: coarse) {
.ios-safari.search-filter input[type="date"]::before {
color: #999;
content: attr(placeholder);
margin-right: 3px;

}

.ios-safari.search-filter input[type="date"]:focus::before {
content: attr(placeholder) !important;
}
}

@media (max-width: 1024px) {

Expand Down
70 changes: 16 additions & 54 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ window.onscroll = () => {

$(document).ready(function () {

// added for 33260 bug
if (/iP(hone|od|ad)/.test(navigator.userAgent) && /Safari/.test(navigator.userAgent) && !/CriOS/.test(navigator.userAgent)) {
// This will add the class 'ios-safari' to the body for iOS Safari only
document.body.classList.add('ios-safari');
}


// Filter Dropdown
if ($("#TopicDropdown").length > 0) {
VirtualSelect.init({
Expand Down Expand Up @@ -1490,61 +1497,13 @@ $(document).ready(function () {
}
});





$('#updatedbefore').on('focusin','input', function () {
var selectedDate = $(this).val();
if (selectedDate === currentDate && !dateCleared) {
$(this).val('');
dateCleared = true;
}
});

var updatedBeforeDateInput = $('#updatedbefore');
updatedBeforeDateInput.on('change', function () {
var value = $(this).val();
var datePattern = /^(\d{2})\/(\d{2})\/(\d{4})$/;
if (datePattern.test(value)) {
return;
} else {
var parts = value.split('/');
if (parts.length === 3) {
var day = parts[0].padStart(2, '0');
var month = parts[1].padStart(2, '0');
var year = parts[2];
var formattedDate = day + '/' + month + '/' + year;
$(this).val(formattedDate);
}
}
});

updatedBeforeDateInput.on('change', function () {
var value = $(this).val();
if (value) {
var parts = value.split('/');
if (parts.length === 3) {
var day = parts[0].padStart(2, '0');
var month = parts[1].padStart(2, '0');
var year = parts[2];
$(this).val(day + '/' + month + '/' + year);
}
}
});


$('#updatedbefore').on('focusin','input', function () {
var selectedDate = $(this).val();
if (selectedDate === currentDate && !dateCleared) {
$(this).val('');
dateCleared = true;
}
});

var updatedBeforeDateInput = $('#updatedbefore');
updatedBeforeDateInput.on('touchstart', function () {
var value = $(this).val();
var value = '';
setTimeout(() => {
value = $(this).val();
}, 0);

var datePattern = /^(\d{2})\/(\d{2})\/(\d{4})$/;
if (datePattern.test(value)) {
return;
Expand All @@ -1560,8 +1519,11 @@ $(document).ready(function () {
}
});

updatedBeforeDateInput.on('touchstart', function () {
updatedBeforeDateInput.on('touchend', function () {
var value = $(this).val();
setTimeout(() => {
value = $(this).val();
}, 0);
if (value) {
var parts = value.split('/');
if (parts.length === 3) {
Expand Down

0 comments on commit ddc0b7a

Please sign in to comment.