Bugzilla – Attachment 171298 Details for
Bug 36217
Jobs page include last hour filter does not work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36217: Use the server's tz to limit the jobs by "enqueued in the last hour"
Bug-36217-Use-the-servers-tz-to-limit-the-jobs-by-.patch (text/plain), 2.92 KB, created by
Martin Renvoize (ashimema)
on 2024-09-11 07:18:38 UTC
(
hide
)
Description:
Bug 36217: Use the server's tz to limit the jobs by "enqueued in the last hour"
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-09-11 07:18:38 UTC
Size:
2.92 KB
patch
obsolete
>From 6c0753b7d5464618a4e2555e2da95876e233230f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 4 Sep 2024 14:20:33 +0200 >Subject: [PATCH] Bug 36217: Use the server's tz to limit the jobs by "enqueued > in the last hour" > >This patch suggests to revert the previous attempt to fix this problem. >The date was using the client-side's tz and so the "last hour" was not >matching the one from the server. > >I have noticed a couple of things when working on this: >* We cannot pass a RFC3339 formatted date to the server (will open a > separate bug report) >* toISOString() and the handling of timezone in dayjs is ambiguous or > buggy >https://github.com/iamkun/dayjs/issues/2720 >https://github.com/iamkun/dayjs/issues/2611 > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc | 2 ++ > .../intranet-tmpl/prog/en/modules/admin/background_jobs.tt | 6 ++++-- > 2 files changed, 6 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc >index bce0620c484..c9b2129749b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc >@@ -59,6 +59,8 @@ > var withtime = (options&&options.withtime)||false; > > if(dateformat=='rfc3339' && withtime) return m.format(); >+ if(dateformat=='iso' && withtime) return m.format("YYYY-MM-DDTHH:mm:ss.sssZ"); // Do not use toISOString(), it does not behave as expected >+ // Might be fixed in a future version of dayjs > > var timeformat = (options&&options.timeformat)||def_time_format; > var date_pattern = get_date_pattern(dateformat); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt >index fb92ebd0e1e..971768332f6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt >@@ -264,9 +264,11 @@ > let now = new Date(); > if ( $("#include_last_hour").is(":checked") ) { > now.setHours(now.getHours() - 1); >- return { ">": now.toISOString() }; >+ let now_with_server_tz = $datetime(now.toISOString(), { dateformat: 'iso' }); >+ return { ">": now_with_server_tz }; > } else { >- return { "<": now.toISOString() }; >+ let now_with_server_tz = $datetime(now.toISOString(), { dateformat: 'iso' }); >+ return { "<": now_with_server_tz }; > } > } > }; >-- >2.46.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36217
:
167526
|
169190
|
169549
|
169635
|
169694
|
171018
|
171019
|
171020
|
171297
| 171298 |
171299