webERP Forum

Full Version: The date does not appear to be in a valid format
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
  
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
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
(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
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.
(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
(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).
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