What is it you are trying to accomplish that you can't achieve with date/time formats? You can always adjust the db to be whatever (or empty) date/time notation you want if you don't want to use the setting provided in the admin area settings.
If you do not have required format in the settings, you can add it. For example, in phpMyAdmin find the cscart_settings_variants table and add new record
In your example is using date_format (standard function in php) not fn_date_format (function from Cs-Cart).
In your modifications, you can use whatever you want.
Best regards
Robert
It's using fn_date_fotmat, if you override it and you can see it gets change! it doesn't use standard php method
What is it you are trying to accomplish that you can't achieve with date/time formats? You can always adjust the db to be whatever (or empty) date/time notation you want if you don't want to use the setting provided in the admin area settings.
What I'm trying to accomplish is converting the date in templates to different calendar types for example :
If you do not have required format in the settings, you can add it. For example, in phpMyAdmin find the cscart_settings_variants table and add new record
Then just select new format on the Settings -> Appearance pahe
definitely, a helpful tip which I need later, but as I explained in my previous post I want to add different calendar types, I don't want to change timestamp and how it's getting stored in DB or format, I want to change it in view ( templates ) based on language another example :
$IntlDateFormatter = new IntlDateFormatter(
‘es_ES@calendar=buddhist’,
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
‘Australia/Yancowinna’,
IntlDateFormatter::TRADITIONAL
);
echo $IntlDateFormatter->format($timestamp);
// martes, 21 de julio de 2558 BE, 23:16:08 (Hora estándar de Australia central)
That would be nice if we could hook or edit fn_date_format without editing core or overriding every template that is using this function, I'm looking for a solution too
You would have to edit the smarty_plugins/modifier.date_format.php file to make the changes you want. It uses fn_date_format(). You can always request a hook be added to fn_date_format(). But cs-cart hasn't responded to the "request a hook" thread in the developer forum for over a year.
Note there are several FIXME lines in fn_date_format() so some changes may be coming in a future release.
definitely, a helpful tip which I need later, but as I explained in my previous post I want to add different calendar types, I don't want to change timestamp and how it's getting stored in DB or format, I want to change it in view ( templates ) based on language another example :
Please note that our solution will change timestamp format stored in database. It just adds new format which will be processed in templates only (in fn_date_format function)
You would have to edit the smarty_plugins/modifier.date_format.php file to make the changes you want. It uses fn_date_format(). You can always request a hook be added to fn_date_format(). But cs-cart hasn't responded to the "request a hook" thread in the developer forum for over a year.
Note there are several FIXME lines in fn_date_format() so some changes may be coming in a future release.
That's sad they won't listen to hook requests :(,
Thanks for smarty modifier hint, I think that would be the best place for now since it's less likely to get updated and could be skipped during upgrades
Please note that our solution will change timestamp format stored in database. It just adds new format which will be processed in templates only (in fn_date_format function)
My problem is I don't need a new format, I want to convert the date to different calendar types via PHP Intl
I think I go with smarty date_format modifier and use my function there