This is an automated email from the ASF dual-hosted git repository.

dsmiley pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git

commit f73c4e2c10315ad52f5b80e158268fc69026a4dc
Author: Jan Høydahl <[email protected]>
AuthorDate: Tue Nov 10 22:46:57 2026 +0100

    Admin UI: accept offset time zones such as GMT+05:00 on the replication 
screen (#5318)
    
    (cherry picked from commit da3ba55d08057bc8c698c2f596e5a05eddb1589d)
    (cherry picked from commit a60a95133ca163af3f78c928c70169a5fd80de37)
---
 .../PR#5318-adminui-replication-offset-timezones.yml           | 10 ++++++++++
 solr/webapp/web/js/angular/controllers/replication.js          |  3 ++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git 
a/changelog/unreleased/PR#5318-adminui-replication-offset-timezones.yml 
b/changelog/unreleased/PR#5318-adminui-replication-offset-timezones.yml
new file mode 100644
index 00000000000..2b8253a49a6
--- /dev/null
+++ b/changelog/unreleased/PR#5318-adminui-replication-offset-timezones.yml
@@ -0,0 +1,10 @@
+title: >
+  The Admin UI replication screen no longer fails with a JavaScript TypeError 
when the server
+  runs in a time zone without an abbreviation, such as Etc/GMT-5, which Java 
renders as GMT+05:00.
+type: fixed
+authors:
+  - name: Jan Høydahl
+    nick: janhoy
+links:
+  - name: PR#5318
+    url: https://github.com/apache/solr/pull/5318
diff --git a/solr/webapp/web/js/angular/controllers/replication.js 
b/solr/webapp/web/js/angular/controllers/replication.js
index 6e5fd50086a..9eb1ed315fc 100644
--- a/solr/webapp/web/js/angular/controllers/replication.js
+++ b/solr/webapp/web/js/angular/controllers/replication.js
@@ -157,7 +157,8 @@ var getFollowerVersions = function(data) {
 
 var parseDateToEpoch = function(date) {
     // ["Sat Mar 03 11:00:00 CET 2012", "Sat", "Mar", "03", "11:00:00", "CET", 
"2012"]
-    var parts = date.match( 
/^(\w+)\s+(\w+)\s+(\d+)\s+(\d+\:\d+\:\d+)\s+(\w+)\s+(\d+)$/ );
+    // The zone may also be an offset such as "GMT+05:00", so it must not be 
restricted to \w+
+    var parts = date.match( 
/^(\w+)\s+(\w+)\s+(\d+)\s+(\d+\:\d+\:\d+)\s+(\S+)\s+(\d+)$/ );
 
     // "Sat Mar 03 2012 10:37:33"
     var d = new Date( parts[1] + ' ' + parts[2] + ' ' + parts[3] + ' ' + 
parts[6] + ' ' + parts[4] );

Reply via email to