mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-11 01:35:22 +01:00
Generalizing TimezoneOffset field init
This commit is contained in:
parent
e3a8e1a187
commit
7bcc559ec7
2 changed files with 6 additions and 3 deletions
|
@ -386,8 +386,6 @@
|
|||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var timezoneOffset = new Date().getTimezoneOffset();
|
||||
$("#TimezoneOffset").val(timezoneOffset);
|
||||
$(".export-link, a.dropdown-item").each(function () {
|
||||
this.href = this.href.replace("timezoneoffset=0", "timezoneoffset=" + timezoneOffset);
|
||||
});
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
$(function () {
|
||||
$(function () {
|
||||
// initialize timezone offset value if field is present in page
|
||||
var timezoneOffset = new Date().getTimezoneOffset();
|
||||
$("#TimezoneOffset").val(timezoneOffset);
|
||||
|
||||
// localize all elements that have localizeDate class
|
||||
$(".localizeDate").each(function (index) {
|
||||
var serverDate = $(this).text();
|
||||
var localDate = new Date(serverDate);
|
||||
|
|
Loading…
Add table
Reference in a new issue