×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Changing date format, kills hotspots

Changing date format, kills hotspots 12 years 2 months ago #15373

  • Johnny Dement
  • Johnny Dement's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 26
  • Thank you received: 0
Changing from Y-m-d to d-m-Y makes the locations dissapear

Re: Changing date format, kills hotspots 12 years 2 months ago #15374

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Johny,
Are you on joomla 1.7 or 2.5??? Please hover over the date label and read the description on 1.7 and 2.5 you have different syntax.

And if in the field it says d-m-Y - we internally change it to %d%m%y for joomla 1.7 - but if you change it to something else, then we assume that you have added correct strings in the field...

Anyway - check the description and you'll get it.

cheers,
Daniel

Re: Changing date format, kills hotspots 12 years 2 months ago #15375

  • Johnny Dement
  • Johnny Dement's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 26
  • Thank you received: 0
2.5

I just replace %Y-%m-%d %H:%M:%S with %d-%m-%Y %H:%M:%S

I know how date works already, thanks ;)

Re: Changing date format, kills hotspots 12 years 2 months ago #15379

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Johnny,
Sorry, but it wasn't clear from your last reply - did you solve your problem or not?
Regards,
Daniel

Re: Changing date format, kills hotspots 12 years 2 months ago #15381

  • Johnny Dement
  • Johnny Dement's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 26
  • Thank you received: 0
Nope, the moment I change to %d-%m-%Y %H:%M:%S all previous hotspots don't appear, nor the ones created after the change.

I've tried editing old ones, and creating news, but they don't appear, if I revert back to default date format, there they are...

Re: Changing date format, kills hotspots 12 years 2 months ago #15382

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Ok, I found the problem. First of all for joomla 2.5 you need to follow the date syntax: php.net/manual/en/function.date.php

it will be something like d-m-Y and not %d-%m-%Y...

And now we come to the bug.. In components/com_hotspots/views/json/tmpl/default_description.php on line 30 we have:
<?php echo hotspotsUtils::getLocalDate($this->hotspot->postdate);?>

and it should be jsut
<?php echo ($this->hotspot->postdate);?>

It is a bug, because in the view.raw.php file we already have parsed the date with hotspotsUtils::getLocalDate($this->hotspot->postdate) and if we try to parse it again in the default_description, then the jdate function can't handle it...

Make the change it should work.
Cheers,
Daniel

Re: Changing date format, kills hotspots 11 years 10 months ago #16310

  • Johnny Dement
  • Johnny Dement's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 26
  • Thank you received: 0
Sorry, did forgot to update thread ;)

I can confirm the bug is fixed in upcoming beta version ;)

Although I would suggest to change it to not think stable is an update :/ it just keep bugging me to update :P
  • Page:
  • 1
Time to create page: 0.116 seconds