Project

General

Profile

Bug #4609

Documents: bad update time label

Added by Juan Carlos Raña Trabado over 7 years ago. Updated about 7 years ago.

Status:
Bug resolved
Priority:
Urgent
Assignee:
-
Category:
-
Target version:
Start date:
13/04/2012
Due date:
% Done:

50%

Estimated time:
Spent time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

En la herramienta documentos, si se crea un archivo entre las doce de la noche y la una de la mañana del día (es decir la primera hora del día) le asigna un horario como si hubiera sido creada el día anterior.


Files

edit_document.php (21 KB) edit_document.php Yoselyn Castillo, 03/07/2012 16:27
main_api.lib.php (223 KB) main_api.lib.php Yoselyn Castillo, 03/07/2012 16:27
edit_document.php (21 KB) edit_document.php Yoselyn Castillo, 26/07/2012 06:48
agenda.png (4.79 KB) agenda.png Julio Montoya, 31/07/2012 14:04

Associated revisions

Revision 2737377d (diff)
Added by Yoselyn Castillo about 7 years ago

Documents: bad label time see #4609

Revision 57b14442 (diff)
Added by Julio Montoya about 7 years ago

undo change see #4609

Revision 8ea76c83 (diff)
Added by Julio Montoya about 7 years ago

Should fix time label bug when creating a document see #4609

History

#1

Updated by Yannick Warnier over 7 years ago

  • Target version set to 1.9 Beta
#2

Updated by Yannick Warnier over 7 years ago

  • Target version changed from 1.9 Beta to 1.9 RC1
#3

Updated by Yoselyn Castillo about 7 years ago

  • Status changed from New to Assigned
  • Assignee set to Yoselyn Castillo
#4

Updated by Yoselyn Castillo about 7 years ago

  • Status changed from Assigned to Needs testing
  • % Done changed from 0 to 60

I have to test the changes at the time specified in the description

#5

Updated by Yoselyn Castillo about 7 years ago

Upload these files. Fixed

#6

Updated by Julio Montoya about 7 years ago

  • Assignee changed from Julio Montoya to Yoselyn Castillo

Hello Yoselyn,

We don't use anymore the mysql function NOW check the coding conventions we use the api_get_utc_datetime()

http://support.chamilo.org/projects/chamilo-18/wiki/Coding_conventions

#7

Updated by Yoselyn Castillo about 7 years ago

  • Assignee changed from Yoselyn Castillo to Julio Montoya

Upload just the edit_document.php file for doing a test.

#8

Updated by Julio Montoya about 7 years ago

  • Assignee changed from Julio Montoya to Yoselyn Castillo

Yoselyn Castillo wrote:

Upload just the edit_document.php file for doing a test.

you forgot to add the file?

#9

Updated by Yannick Warnier about 7 years ago

Yoselyn, aquí falta el archivo!

#10

Updated by Yoselyn Castillo about 7 years ago

  • Assignee changed from Yoselyn Castillo to Julio Montoya

Es el que habia adjuntado antes edit_document.php

#11

Updated by Julio Montoya about 7 years ago

  • Assignee changed from Julio Montoya to Yoselyn Castillo

Acabo de enviar el archivo edit_document.php, el otro archivo main.api no ha sido subido por lo que comentaba que no usamos la función NOW de mysql

#12

Updated by Yannick Warnier about 7 years ago

  • Target version changed from 1.9 RC1 to 1.9 Stable
#13

Updated by Yoselyn Castillo about 7 years ago

Sube el file edit_document.php este para restablecer el cambio anterior

#14

Updated by Julio Montoya about 7 years ago

  • Status changed from Assigned to Needs more info
  • Assignee changed from Julio Montoya to Yoselyn Castillo

archivo enviado.

#15

Updated by Yannick Warnier about 7 years ago

  • Subject changed from bad label time - documents tool to Documents: bad update time label
  • Assignee deleted (Yoselyn Castillo)

Updating title and unassigning from Yoselyn as we need tests from someone else.
Maybe Coursenligne or Juan Carlos can help us close it?

#16

Updated by Yannick Warnier about 7 years ago

  • Status changed from Needs more info to Needs testing
  • Assignee set to Juan Carlos Raña Trabado
#17

Updated by Juan Carlos Raña Trabado about 7 years ago

Sinceramente sigo viendo que se produce el mismo error. Cuando se crea un documento entre las 00:00 y las 01:00 le pone fecha de ayer, cuando en realidad tendría que poner fecha de hoy, pues se trata de la primera hora del día.

#18

Updated by Yannick Warnier about 7 years ago

  • Status changed from Needs testing to Assigned
  • Assignee changed from Juan Carlos Raña Trabado to Julio Montoya
  • Priority changed from Normal to Urgent
  • % Done changed from 80 to 50

Juan Carlos Raña wrote:

Sinceramente sigo viendo que se produce el mismo error. Cuando se crea un documento entre las 00:00 y las 01:00 le pone fecha de ayer, cuando en realidad tendría que poner fecha de hoy, pues se trata de la primera hora del día.

A mi me reportan que esto ocurre también (al revés para Perú, pues estamos a GMT-5 y tu a GMT+2) para calendario y asistencias. Esto llega a ser prioritario ahora para 1.9.

En resumen (si no me equivoco) para reproducir:

  • poner el portal en una zona horaria (cualquiera que no sea UTC)
  • grabar un documento, evento o asistencia en una hora cerca de medianoche (si el portal está en GMT+x como Bruselas, entonces poner a la 1am, si está en GMT-x como Lima, poner a las 11pm)
  • revisar la interfaz que indica el día

En el calendario, esto ocurre solo para un tipo de eventos (no me acuerdo cual, los personales o los de cursos). *

#19

Updated by Julio Montoya about 7 years ago

revisando este bug ...

#20

Updated by Julio Montoya about 7 years ago

He probado lo que menciona Yannick:

En mi php.ini tengo: date.timezone = "Europe/Paris"

En chamilo tengo America/Lima

Creé 2 eventos uno personal y otro dentro de un curso con esta fecha:

Mar 31 Jul 2012 23:00:00 - 23:30:00

Se ve correctamente en ambos casos.

ver imagen:

Voy a probar con los documentos

#21

Updated by Julio Montoya about 7 years ago

Acabo de encontrar unos problemillas con el uso de esta funciǿn:

$last_edit_date = api_get_local_time($last_edit_date, null, date_default_timezone_get());

se debería de usar simplement:

$last_edit_date = api_get_local_time($last_edit_date);

He hecho unas pruebas cambiando la hora de mi PC y parece funcionar.

#22

Updated by Julio Montoya about 7 years ago

  • Status changed from Assigned to Needs testing
  • Assignee deleted (Julio Montoya)

En las asistencias tambien parece funcionar bien he creado eventos desde hoy 31 de julio a las 1130pm hasta el 7 de agosto y todo parece bien ...

#23

Updated by Yannick Warnier about 7 years ago

Hola Julio, en los documentos también lo revisaste, verdad?

#24

Updated by Julio Montoya about 7 years ago

si, ya envié código

#25

Updated by Yannick Warnier about 7 years ago

Test from document: I set my platform as Europe/Brussels and send documents at 4pm, Brussels time:
  • time is stored as UTC time: OK
  • I change the time stored in the database to 00:43:00 UTC time, it still displays "today": OK
  • I change the time stored in the database to yesterday at 23:43:00 UTC time, it still displyas "today": OK (Brussels is 2 hours ahead so it is equivalent to 01:43:00, so today indeed)
  • I change the time stored in the database to yesterday at 21:43:00 UTC time, it displays as "yesterday": OK

I'm currently stuck in my testing because I cannot change my personal timezone, which "seems" (not sure yet) to be related to this commit http://code.google.com/p/chamilo/source/detail?repo=classic&r=0b5d08b71664163570452a19869e8b2dc436270e&spec=svn.classic.0b5d08b71664163570452a19869e8b2dc436270e#

#26

Updated by Yannick Warnier about 7 years ago

Changing personal timezone gives the right results as well. The only remaining bit is testing the agenda...

#27

Updated by Yannick Warnier about 7 years ago

  • Status changed from Needs testing to Bug resolved

OK, good for me! I tested the agenda both from course and globally, with 2 different timezones, both in personal and platform context, and it matches what should be expected each time. Closing.

Also available in: Atom PDF