score:0
The problem looks like to be in the regexp \w
not matching accentuated letters.
You could either:
- simply, first unaccentuate Date and time before check regexp, see for example Remove accents/diacritics in a string in JavaScript
- or, make the regexp compatible with accents, diacritics. See Concrete Javascript Regex for Accented Characters (Diacritics), or What's a good regex to include accented characters in a simple way?, or any equivalent
score:1
In your regular expression, \w
doesn't match characters with accents (diacritics). See Concrete Javascript Regex for Accented Characters (Diacritics)
You can replace your regular expression \w
with [A-Za-z脌-脰脴-枚酶-每]
// we have to iterate backwards...
$($('.schedule-show').get().reverse()).each(function(i, div){
let time = $(div).find('[data-timezone="et"]')
let nextTime = $(div).find('+ .schedule-show [data-timezone="et"]')
if(nextTime[0]){
// check if they dates match
if(nextTime.text().match(/\d+ \w+/)[0] === time.text().match(/\d+ \w+/)[0]){
// "white out" the dates that match
nextTime.html(nextTime.text().replace(/(\d+ [A-Za-z脌-脰脴-枚酶-每]+)/, "<font color=\"white\">$1</font>"))
}
}
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="schedule-wrapper" id="js-schedule" data-timezone="et"> /* The value of data-timezone attribute changes on button click from the Screenshot below */
<!-- List of button start -->
<div class="schedule-action-bar">
<div class="schedule-timezone-filter">
Select your timezone:
<ul id="js-timezone-picker">
<li>
<button id="js-time-et" class="" data-timezone="et">ET</button>
</li>
</ul>
</div>
</div>
<!-- List of button end -->
<div class="schedule-show">
<div class="schedule-show-time">
<time datetime="03:45 01-08-2019" data-timezone="et">1 ao没t 03:45</time> /* When timezone is eastern standard time */
</div>
</div>
<div class="schedule-show">
<div class="schedule-show-time">
<time datetime="03:45 01-08-2019" data-timezone="et">1 ao没t 03:45</time> /* When timezone is eastern standard time */
</div>
</div>
<div class="schedule-show">
<div class="schedule-show-time">
<time datetime="03:45 01-08-2019" data-timezone="et">1 ao没t 03:45</time> /* When timezone is eastern standard time */
</div>
</div>
<div class="schedule-show">
<div class="schedule-show-time">
<time datetime="03:45 01-08-2019" data-timezone="et">1 ao没t 03:45</time> /* When timezone is eastern standard time */
</div>
</div>
<div class="schedule-show">
<div class="schedule-show-time">
<time datetime="03:45 01-08-2019" data-timezone="et">1 ao没t 03:45</time> /* When timezone is eastern standard time */
</div>
</div>
<!-- .schedule-show -->
<div class="schedule-show">
<div class="schedule-show-time">
<time datetime="03:45 02-08-2019" data-timezone="et">2 ao没t 03:45</time> /* When timezone is eastern standard time */
</div>
</div>
<div class="schedule-show">
<div class="schedule-show-time">
<time datetime="03:45 02-08-2019" data-timezone="et">2 ao没t 03:45</time> /* When timezone is eastern standard time */
</div>
</div>
<div class="schedule-show">
<div class="schedule-show-time">
<time datetime="03:45 02-08-2019" data-timezone="et">2 ao没t 03:45</time> /* When timezone is eastern standard time */
</div>
</div>
<div class="schedule-show">
<div class="schedule-show-time">
<time datetime="03:45 02-08-2019" data-timezone="et">2 ao没t 03:45</time> /* When timezone is eastern standard time */
</div>
</div>
<!-- .schedule-show -->
<div class="schedule-show">
<div class="schedule-show-time">
<time datetime="05:00 02-08-2019" data-timezone="et">2 ao没t 05:00</time> /* When timezone is eastern standard time */
</div>
</div>
<!-- .schedule-show -->
</div>
Related Query
- How to hide a parent by searching for content within a child using jQuery
- How to hide overlapping divs and not remove the content
- How to hide content behind a list in CSS?
- How can I hide or remove the content outside the input field?
- How to hide the scroll bar while the content is scrollable?
- How to create show the content above the button using toggle?
- How to make the content of a carousel change only by clicking on the next and prev buttons?
- How to hide delete key with JQuery
- How to hide div inside iframe?
- How to display the content after this animation?
- How to Hide (or Show) child drop-down (dynamic html) in jquery?
- How To Auto Load div content in PHP codeigniter?
- How to display the show hide option at the end of each column
- How to make content box slide automatically
- How to Hide div based on data attribute
- How to Hide Last Three li form ul?
- How to scroll the content in the left and right direction on hitting an arrow in mobile view?
- How to disable hide on click function with Jquery, in transparent color
- How to pass the content of <option> tag in a Drop Down to the server
- How to make a make Bootstrap 4 slide in menu push content offcanvas?
- How to get content path in thymeleaf?
- How to hide multiple drop downs when page loads using jQuery?
- How can I hide a form after submission?
- How to display the owlCarousel2 slider content in the center?
- How to add to the content of a div without deleting it's original content using javascript
- How can i Show / Hide Div when i navigate from initial page to another and then come back to initial page?
- How to hide a specific fieldset with CSS
- how to get html page content send using a hidden field in a form
- How to dynamically insert html content into an existing html document?
- How to hide specific div when clicked outside the element having same class in multiple div
- How can i get the content of a for attribute from a label?
- How do I force any iframe content to appear on top if changed, without changing the attributes in the links?
- How to split table rows and remove header content color after next page print PDF?
- How to hide navigation parent menu item if one parent menu item contains specific text?
- How to load a content to modal with ajax while using Spring MVC frame work
- How to display notification alert from right side to left and hide after few second
- How do I hide and show my function after a period of time?
- How to dynamically hide the radio buttons based on the previously selected radio buttons?
- How to set autoplay on a div content slider jquery
- How to hide dropdown element depending to another one?
- How can I code the slid down content to slideup when mouse is off the trigger and slid down content?
- how to refresh a specific div content with fade in & fade out
- How to change page content by click over paper-tab?
- How to iterate over Table in Jquery to change the content
- How to hide bpopup jquery?
- How to make rows of equal height with uneven div content in Javascript?
- How can I hide div if it is empty?
- How to hide a list entry in a Wordpress sidebar widget?
- how to find specific class through all child elements and if available then hide that child element?
- JS accordion - hide content when another one is clicked
More Query from same tag
- Getting to grips with pre-loading images
- Filter table with multiple radio inputs
- Expanding lists push other relative positioned elements up - they should stay still
- adding css dynamically in jquery
- Why Cannot I use java script method Sort() on Array objects created from jquery $.makeArray()
- coloring first row in multi tables with jquery
- How to get text field disabled property
- How to remove items out 2d array jQuery
- How to replace brackets in specific attribute in html with js?
- Wrap substring of element content with an element using jQuery
- Package and download zip to Google Drive test
- my express page only loads once and fails the second time
- jQwidgets - Grid View button-cell clicked but that doesnt trigger a row selection
- JQGrid Time reservation...selecting multiple columns
- Pagination prev and next in a loop using jquery
- Difference Between HTTP request in code vs web browser
- Grouping every piece of conditional statement
- JQuery loaded defered. Howto ensure jQuery is loaded?
- Simulating user clicks using JavaScript or JQuery
- ajax cannot find my controller and function when i submit ajax form
- jQuery count li-element and compare with each other. unsorted list in a unsorted list
- Issue with jQuery Autocomplete and Sticky Footer
- append div class within jquery
- Internet explorer cancels ajax requests
- "popover image" - having trouble re-hiding the image after it pops up
- Timers in javascript don't want to stop counting sometimes
- Reload Div on button click
- why am i getting undefined when i use ".on" but a value when i use".click"
- Detect elements with same background-image value and remove
- how to take array items and make corresponding spans in the html