xoops forums

Lupin

Just popping in
Posted on: 4/20 13:23
Lupin
Lupin (Show more)
Just popping in
Posts: 92
Since: 2007/6/1 2
#1

Datetime problems with Publisher 1.07 Final and Xoops 2.5.10

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

Mage

Core Developer
Posted on: 4/20 19:03
Mage
Mage (Show more)
Core Developer
Posts: 188
Since: 2009/8/2 1
#2

Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10

It may be the translation:

https://github.com/XOOPS/XoopsCore25/i ... 49#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

Mage

Core Developer
Posted on: 4/20 19:08
Mage
Mage (Show more)
Core Developer
Posts: 188
Since: 2009/8/2 1
#3

Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10

sorry not local.php but global.php

Lupin

Just popping in
Posted on: 4/21 9:48
Lupin
Lupin (Show more)
Just popping in
Posts: 92
Since: 2007/6/1 2
#4

Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10

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

Lupin

Just popping in
Posted on: 4/21 10:08
Lupin
Lupin (Show more)
Just popping in
Posts: 92
Since: 2007/6/1 2
#5

Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10

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

Mamba

Moderator
Posted on: 4/21 13:01
Mamba
Mamba (Show more)
Moderator
Posts: 10964
Since: 2004/4/23
#6

Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10

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.10 | Docs | Modules | Bugs

Mamba

Moderator
Posted on: 4/21 15:39
Mamba
Mamba (Show more)
Moderator
Posts: 10964
Since: 2004/4/23
#7

Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10

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/ ... 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.10 | Docs | Modules | Bugs

Lupin

Just popping in
Posted on: 4/21 16:27
Lupin
Lupin (Show more)
Just popping in
Posts: 92
Since: 2007/6/1 2
#8

Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10

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.

luciorota

Module Developer
Posted on: 4/21 17:59
luciorota
luciorota (Show more)
Module Developer
Posts: 205
Since: 2007/4/20
#9

Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10

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

luciorota

Module Developer
Posted on: 4/21 19:18
luciorota
luciorota (Show more)
Module Developer
Posts: 205
Since: 2007/4/20
#10

Re: Datetime problems with Publisher 1.07 Final and Xoops 2.5.10

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!