Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The date does not appear to be in a valid format
07-21-2021, 04:24 AM, (This post was last modified: 07-21-2021, 04:24 AM by wissedenis22.)
#1
The date does not appear to be in a valid format
Hello, Is there a clear/permanent solution for "The date does not appear to be in a valid format." I have come across to the related issue'



 however, the error is being displayed most scripts. I guess it's kind of settings but I don't know how/where
  


Attached Files Thumbnail(s)
   
Reply
07-21-2021, 11:36 AM, (This post was last modified: 07-21-2021, 11:41 AM by TurboPT.)
#2
RE: The date does not appear to be in a valid format
Does that only happen with the displayed option, or others?
Is there customized code in use?
In the browsers console, are there any javascript error(s) when that page loads?

Also, in System Parameters, what is set for:
  1. Financial Year Ends On
  2. Default Date Format
Reply
07-21-2021, 08:15 PM,
#3
RE: The date does not appear to be in a valid format
This is caused by something different than the errors in the threads you linked to. I suspect you have got the configuration wrong for your customer. As well as the things that Paul mentioned, check your setting for the ProhibitPostingsBefore config.

This error message is produced by the ConvertSQLDate() function, which in turn is called by the GetPeriod() function from the GLBudgets.php script on line 122. If you are stuck, try inserting some debug info into these scripts and see what info it produces.

Tim
Reply
07-23-2021, 04:52 PM, (This post was last modified: 07-23-2021, 04:53 PM by wissedenis22.)
#4
RE: The date does not appear to be in a valid format
(07-21-2021, 11:36 AM)TurboPT Wrote: Does that only happen with the displayed option, or others?
Is there customized code in use?
In the browsers console, are there any javascript error(s) when that page loads?

Also, in System Parameters, what is set for:
  1. Financial Year Ends On
  2. Default Date Format
the error displayed even to other pages! the code is not customized am using webERP version 4.14.1


Attached Files Thumbnail(s)
       
Reply
07-24-2021, 08:27 PM, (This post was last modified: 07-24-2021, 08:32 PM by TurboPT.)
#5
RE: The date does not appear to be in a valid format
What is set to the configuration option shown in the image below?

Also, can you check the browser console for possible javascript errors?

For Firefox or Chrome, Ctrl+Shift+J will open the browser console.

Don't panic if many errors appear, because there may be unrelated errors listed with files that the browser uses, but specifically look for any entries listed for the two webERP javascript files found in the /javascripts directory. The file name is listed to the far right of each error message.

One other thing: try clearing the browser cache, which sometimes helps to resolve quirky behavior.


Attached Files Thumbnail(s)
   
Reply
07-24-2021, 08:31 PM,
#6
RE: The date does not appear to be in a valid format
(07-24-2021, 08:27 PM)TurboPT Wrote: What is set to the configuration option shown in the image below?

Check that the values in the config table agree with what you are expecting as well, not just the interface.

Tim
Reply
08-24-2021, 09:05 PM,
#7
RE: The date does not appear to be in a valid format
(07-24-2021, 08:31 PM)falkoner Wrote:
(07-24-2021, 08:27 PM)TurboPT Wrote: What is set to the configuration option shown in the image below?

Check that the values in the config table agree with what you are expecting as well, not just the interface.

Tim
I thinking of going ahead and remove the default date/value (0000-00-00).


Attached Files Thumbnail(s)
   
Reply
08-24-2021, 11:17 PM,
#8
RE: The date does not appear to be in a valid format
No, that won't help you as that is the database table configuration and this is a PHP error. As I said previously this error is generated by the ConvertSQLDate() function, which in turn is called by the GetPeriod() function from the GLBudgets.php script. The relevant code can be found at circa line 117.

PHP Code:
    $YearEndYear=Date('Y'YearEndDate($_SESSION['YearEnd'],0));

/* If the periods dont exist then create them */
    
for ($i=1$i <=36$i++) {
        
$MonthEnd=mktime(0,0,0,$_SESSION['YearEnd']+1+$i,0,$YearEndYear-2);
        
$period=GetPeriod(Date($_SESSION['DefaultDateFormat'],$MonthEnd), false);
        
$PeriodEnd[$period]=Date('M Y',$MonthEnd);
    } 


You are I think sending an incorrect parameter to GetPeriod(). Insert the following PHP instead of the above:

PHP Code:
    $YearEndYear=Date('Y'YearEndDate($_SESSION['YearEnd'],0));
    echo 
'Date Format - '$_SESSION['DefaultDateFormat'], '<br />';
    echo 
'YearEndYear - '$YearEndYear'<br />';
/* If the periods dont exist then create them */
    
for ($i=1$i <=36$i++) {
        
$MonthEnd=mktime(0,0,0,$_SESSION['YearEnd']+1+$i,0,$YearEndYear-2);
        echo 
'MonthEnd - '$MonthEnd'<br />';
        
$period=GetPeriod(Date($_SESSION['DefaultDateFormat'],$MonthEnd), false);
        
$PeriodEnd[$period]=Date('M Y',$MonthEnd);
    } 

and let  us know the output.


Tim
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)