Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0005273Openbravo ERPB. User interfacepublic2008-09-25 16:572009-02-18 11:04
plujan 
dbaz 
normalminorhave not tried
closedfixed 
5
2.40 
pi 
Core
No
0005273: When entering dates with dd-mm-yy format are saved as dd-mm-00yy
On PostgreSQL, if I enter a date in a two year format, by example 21-09-08, it is saved on database as 21-09-0008.
1. Go Sales Order and create a new one.
2. On Order Date field enter 21-09-08
3. Note that no AJAX warning is shown.
4. Save
5. The Order is saved, but date changed to 21-09-0008
*2-digit year dates should be managed using a 100 year range. By example, dates between 1920 and 2019 are interpreted correctly when written in 2-digit format

*Display a proper warning message like "This date is probably wrong" for strange dates like year before 1900 or dates 50 years away from current year, so the user could continue at his/her own risk.

*Do not allow user to enter less than 4 digit on years
No tags attached.
depends on backport 0005290 closed dbaz When entering dates with dd-mm-yy format are saved as dd-mm-00yy 
related to defect 0008417 closed dbaz Auto fill functionality for date fields (for years) not working in Reports (Warehouse management) 
Issue History
2008-09-25 16:57plujanNew Issue
2008-09-25 16:57plujanAssigned To => cromero
2008-09-25 16:57plujansf_bug_id0 => 2128584
2008-09-25 16:57plujanRegression testing => No
2008-09-29 09:57psarobeStatusnew => scheduled
2008-09-29 09:57psarobeAssigned Tocromero => dbaz
2008-09-29 09:57psarobefix_in_branch => trunk
2008-12-09 12:58dbazNote Added: 0011063
2009-02-10 02:38dbazNote Added: 0013283
2009-02-10 02:38dbazNote Edited: 0013283
2009-02-10 02:40svnbotCheckin
2009-02-10 02:40svnbotNote Added: 0013284
2009-02-10 02:40svnbotStatusscheduled => resolved
2009-02-10 02:40svnbotResolutionopen => fixed
2009-02-10 02:40svnbotsvn_revision => 12987
2009-02-18 11:04sureshbabuStatusresolved => closed
2009-02-18 11:04sureshbabuNote Added: 0013631
2009-02-18 11:04sureshbabuFixed in Version => trunk
2009-04-20 10:06dbazRelationship addedrelated to 0008417

Notes
(0011063)
dbaz   
2008-12-09 12:58   
The right solution would be that when a user enter a 2 year-digit date, the date automatically becomes completed using Javascript.

For example, when a user types 02-02-82 the date automatically should become changed to 02-02-1982 just before do the validation that is going to show an error message (if there would be).

The date range to do the auto-completion should be 1920-2019
(0013283)
dbaz   
2009-02-10 02:38   
Finally the solution is that if a YYYY (for the year representation) is set in Openbravo.properties, any two digit input will be rounded as:

00 -> 49 .......... 2000 -> 2049
50 -> 99 .......... 1950 -> 1999

If anyone should have another range proposal, just tell me.

The proposed range is set in the variable

centuryReference

of the function

expandDateYear

of the file

web/js/default/DateTextBox.js

(0013284)
svnbot   
2009-02-10 02:40   
Repository: openbravo
Revision: 12987
Author: dbaz
Date: 2009-02-10 02:40:40 +0100 (Tue, 10 Feb 2009)

Fixed bug 5273: Now two yeard digit inputs are completed when YYYY format is set (just in WAD windows)

---
U trunk/src-wad/src/org/openbravo/wad/controls/WADDate.html
U trunk/web/js/default/DateTextBox.js
---

https://dev.openbravo.com/websvn/openbravo/?rev=12987&sc=1 [^]
(0013631)
sureshbabu   
2009-02-18 11:04   
Working fine retested in context 79.125.56.185/openbravotrunk