News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Shop date format issue

Started by jjk, September 15, 2011, 13:54:21 PM

Previous topic - Next topic

jjk

When I change the 'Shop date format'  format in VM2 SVN Revision 4114 configuration "%d/%m/%y" and click on 'Coupons' - 'New' thereafter, I get the following error message:
DateTime::__construct() [datetime.--construct]: Failed to parse time string (15/09/11) at position 0 (1): Unexpected character
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Studio 42

First you have to know is J1.7 dont use this format anymore
date are now with no % as PHP date function (joomla 1.5 used sprint_f)
joomla 1.7 date y/m/d
joomla 1.5 date y%/%m/%d

But its strange you have a failure, i want to delete this because the date is not generated by this string (can be in coupon i have mis this).
Due to integration of the format by langue the date format are from Joomla or Virtuemart(next step, i mean, we use only virtuemart format then you can change the formating for your shop and add new in the language keys)
We try now to use convention y/m/d in france for eg., but i have to write a wiki page for the translaters to give the reference/convention link.

If you want to change the dates format you have now to modify the language string but this must be use the local convention in original language key.

jjk

#2
Thanks for the info!

Might be a a Joomla bug. See here: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=20826 (scroll to the bottom of the page)
I didn't check if there is a corresponding post on github already.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Studio 42

Hi jjk,

PLz try to update from SVN.
I have do a correction for this

Greets,
Patrick

jjk

Hi,

I'm not shure - what did you change? Should it be possible now to change the default date format in the BE 'Configuration' - 'Shop' - 'Shop date format' field from "%m/%d/%y" to a different setting, i.e. "d/m/y" without triggering the error on the 'Orders & Shoppers' - 'Coupons' - 'New' view?

I just tried a few different formats again, but still got for exemple: "500 - An error has occurred.
DateTime::__construct() [datetime.--construct]: Failed to parse time string (d-m-y) at position 1 (-): Unexpected character
or
DateTime::__construct() [datetime.--construct]: Failed to parse time string (16/09/11) at position 0 (1): Unexpected character (after entering %d/%m/%y)

I would prefer a format that displays "Day-Month-Year" rather than the american "Month-Day-Year"
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Milbo

the best is anyway year, month, day.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

jjk

#6
I disagree  ;D  (concerning using VM2 in european countries)
However, meanwhile I found a solution that displays "Day/Month/Year". After adding the corresponding keys/strings from the french language file, you just have to leave the 'Configuration - Shop Settings - Shop date format' entry field empty.

... I guess I have to update the german language files again...

BTW - I just noticed something in the BE com_virtuemart.ini:
COM_VIRTUEMART_DATE_FORMAT_INPUT_JS="y.mm.dd" ยป is the single "y" character correct or is this a typo and should read "yy" or "yyyy"?
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Milbo

Quote from: Milbo on September 16, 2011, 17:07:19 PM
the best is anyway year, month, day.

I just meant what would be the best, like ISO standard. or year, day, month.... in fact day, month, year is big nonsense.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

jjk

...but we proponents of Day/Month/Year are the vast majority on the globe  ;D
See here: http://en.wikipedia.org/wiki/Date_format_by_country
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Milbo

When I set a standard, I dont care about majorities. I am a ***obscenity removed*** technician, choosing what would best serve the purpose.

ISO standard of meters and kilometers was choosen by logic, not what is most spread (we would have pounds and miles in that case)
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Studio 42

COM_VIRTUEMART_DATE_FORMAT_INPUT_JS is for javascript date picker

only modify it if you use another date picker


jjk

#11
Quote from: Electrocity on September 28, 2011, 05:22:18 AM
COM_VIRTUEMART_DATE_FORMAT_INPUT_JS is for javascript date picker
only modify it if you use another date picker

Do you mean the string in the ini file should only be changed if you use another date picker?

At present I have an notice on the 'Orders & Shoppers' - 'Revenue Report' again showing:
Notice: Undefined property via __get(): _date in ...\administrator\components\com_virtuemart\models\report.php on line 66 in D:\xampp\htdocs\J17vm2svn\libraries\joomla\utilities\date.php on line 231
Notice: Undefined property via __get(): _date in ...\administrator\components\com_virtuemart\models\report.php on line 68 in D:\xampp\htdocs\J17vm2svn\libraries\joomla\utilities\date.php on line 231

Maybe this is due to updating to Joomla 1.7.1 yesterday. There has been a Joomla bug fix concerning the date format.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Studio 42

hi,
we do next an virtuemart function because joomla always change it and at end the function to resolve the bugs are bigger then a new virtuemart function

Robert_ITMan

#13
Thanks to above for pointing me in the right direction as your info was enough for me to get this working for my sites. I wanted the result showing in the field to show in ISO format 2013-02-20 when using the datepicker instead of 13.02.20 and I found it in 2 places, better to edit the first so it's in the language file - the second I point out because it refers to a different value than that pointed out previously - which is why it didn't fix our problem:

(1) in the language file \language\en-GB\en-GB.com_virtuemart.ini

COM_VIRTUEMART_DATE_FORMAT_INPUT_J16="yy-m-d"
(notice several lines above this that should be changed aswell)

(2) at line 1238 in \administrator\components\com_virtuemart\helpers\config.php

$dateFormat =  JText::_('COM_VIRTUEMART_DATE_FORMAT_INPUT_J16');//="m/d/y"

Hope this note helps someone.
WEBSITES @ OURFINGERTIPS
manage > develop > market > repeat

Save a lot of time and money when focused on building a website that works with marketing efforts to get more leads and sales from visitors.

www.ourfingertips.com