1
Lupin
Datetime problems with Publisher 1.07 Final and Xoops 2.5.10
  • 2020/4/20 13:23

  • Lupin

  • Just popping in

  • Posts: 92

  • Since: 2007/6/1 2


We are talking about the panel for sending and modifying the publisher form; we set the datetime format as d-M-Y H:i . Really the module shows the date and time in the required way. The form calendar also inserts the date in this format, but ...

1) the printed timetable is two hours in advance of the inserted one.
( module is set with GMT+1 ) Can the time zone entered by the user on his account page change this situation? ( i.e. if I set 13,30 I obtain 11,30 )

2) I think when I send the form , the module interprets the format as M-d-Y H:i and not d-M-Y H:i as requested.
in fact, if send (both acting with the calendar and modifying the date field) 01/01/2020 it seems all correct ; but if I exceed the number 12 in the day field ( i.e. 28/03/2020 ) I obtain the date : 01 Jan 1970 .... further proof is that if i send 02/04/2020 i get 04 Feb 2020 ...

3) there is a template problem too ( I mean the submission form on the user side and not the administration side one ) ...if I open the calendar of the form submission date, a part of it remains hidden from the date field of the expiry date section.

Cya guys

Pino

2
Mage
Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10
  • 2020/4/20 19:03

  • Mage

  • Core Developer

  • Posts: 208

  • Since: 2009/8/2 1


It may be the translation:

https://github.com/XOOPS/XoopsCore25/issues/249#issuecomment-261805315

If I understand correctly, you speak Italian! So you use a European date format

in folder:
htdocs\language\italian

file local.php
file global.php

you must have:

define('_DATESTRING''d-m-Y H:i:s');
define('_MEDIUMDATESTRING''d-m-Y H:i');
define('_SHORTDATESTRING''d-m-Y');


if you have

define('_DATESTRING''d/m/Y H:i:s');
define('_MEDIUMDATESTRING''d/m/Y H:i');
define('_SHORTDATESTRING''d/m/Y');


it does not work!


Look this: https://github.com/XOOPS/XoopsCore25/issues/807

3
Mage
Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10
  • 2020/4/20 19:08

  • Mage

  • Core Developer

  • Posts: 208

  • Since: 2009/8/2 1


sorry not local.php but global.php

4
Lupin
Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10
  • 2020/4/21 9:48

  • Lupin

  • Just popping in

  • Posts: 92

  • Since: 2007/6/1 2


I will check thanks !

Sorry, the theme I'm using is "xwatch" ( about template problem ) ; of course I can fix this, but I think it is correct to report.

A further question : in view mode "Full View" pagination doesn't appear ... it is because this mode is intended to have a unique long list, or it is only a simple forgetfulness?



Cya

Pino

5
Lupin
Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10
  • 2020/4/21 10:08

  • Lupin

  • Just popping in

  • Posts: 92

  • Since: 2007/6/1 2


No, it doesn't work.

The problem is I MUST enter the date as "m/d/Y " to correctly store the data that ONLY AFTER during the visualization, is transformed as requested in "d/m/Y"

I think both date format setting on global.php and in admin page ( preferences ) do not change the problem.

Pino

6
Mamba
Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10
  • 2020/4/21 13:01

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


Try with a different theme to see if there is an issue with xswatch or with Core or with Publisher.

You can also test it on XOOPS 2.5.11 with xswatch4, which is based on Bootstrap 4

And please provide the steps that I could try to replicate here, to see what is happening.
Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

7
Mamba
Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10
  • 2020/4/21 15:39

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


Couple of older links for you, so you can take a look and see if they can help you.

https://xoops.org/modules/newbb/viewtopic.php?post_id=343268#343268

https://www.frxoops.org/modules/newbb/viewtopic.php?topic_id=35445&post_id=218518#forumpost218518

https://xoops.org/modules/newbb/viewtopic.php?post_id=358022#358022

I did look at the Italian translation that is on GitHub, and you have there this in global.php,

define('_MEDIUMDATESTRING',"j/n/Y G:i");
define('_SHORTDATESTRING',"j/n/Y");

define('_DBDATESTRING',"Y-m-d");
define('_DBTIMESTRING',"H:i:s");
define('_DBTIMESTAMPSTRING',"Y-m-d H:i:s");
Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

8
Lupin
Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10
  • 2020/4/21 16:27

  • Lupin

  • Just popping in

  • Posts: 92

  • Since: 2007/6/1 2


Hi Mamba ,

I think the problem is inherent in publisher.

- it is present in all three themes that I have available ( xswatch, xbootsptrap and default )
- It is NOT present in wggallery and adslight in the same installation.

Cya

Pino

ooops I've seen just now you second post ... I will check and report.

9
luciorota
Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10
  • 2020/4/21 17:59

  • luciorota

  • Module Developer

  • Posts: 216

  • Since: 2007/4/20


Hi Lupin /Ciao Lupin

Do not change

define('_DBDATESTRING',"Y-m-d");
define('_DBTIMESTRING',"H:i:s");
define('_DBTIMESTAMPSTRING',"Y-m-d H:i:s");


These definition are db related (MySQL date and time data types) and they are NOT dependent on the language used ...

Lucio

10
luciorota
Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10
  • 2020/4/21 19:18

  • luciorota

  • Module Developer

  • Posts: 216

  • Since: 2007/4/20


The bug is the result of an incorrect use of the function strtotime(), it must have a format in English to work...

BUGFIX

file: publisher\class\item.php, line 1061
replace
$localTimestamp strtotime($resDate['date']) + $resTime['time'];


with
$dateTimeObj DateTime::createFromFormat(_SHORTDATESTRING$resDate['date']);
$dateTimeObj->setTime(000);
$localTimestamp $dateTimeObj->getTimestamp() + $resTime['time'];


file: publisher\class\item.php, line 1088

replace
$localTimestamp strtotime($resExDate['date']) + $resExTime['time'];


with
$dateTimeObj DateTime::createFromFormat(_SHORTDATESTRING$resExDate['date']);
$dateTimeObj->setTime(000);
$localTimestamp $dateTimeObj->getTimestamp() + $resExTime['time'];


Good job! / Buon lavoro!

Login

Who's Online

239 user(s) are online (124 user(s) are browsing Support Forums)


Members: 0


Guests: 239


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits