HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Possible related problem with catalogue dates field and sorting

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#52736 (In Topic #11473)
Avatar

Fan in action

Hi,

The two fixes above seem to work, thanks for that. I am having another problem that I suspect may be related. It could however just be something that I shouldn't expect to work so if you could let me know that would be good.

I have a bunch of catalogue date fields. They are entry dates for competitions. I want to be able to sort on these so that the furthest away ones are at the bottom of the list.

I thought I would be able to do this using the inbuilt sort option on the catalogue screens on that field but this doesn't work. Should I assume that you can't sort on date fields for catologues or am I missing something here?

Cheers,

Andrew
Back to the top
 
Posted
Rating:
#52737
Avatar

Hi,

This should fix your problem.

Attachment
sources/catalogues.php
» Download: catalogues.php (36 Kb, 90 downloads so far)


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#52739
Avatar

Fan in action

Possible Date catalogue field time problem

Hi Chris,

Sorry to bang on about this but I think there might be an outstanding problem with the date fix from earlier. Possibly there is a way around this with Tempcode but I am not sure.

What I want to have is a date field with just the date in it that I can display. I set the date to, for example, "August, 1st, 2009". No time information in there. Save the date. Go back in to edit it and the time is set to 12:08

A couple of questions here I guess:

i) Is there actually a no-time option on that date field?
ii) If there is, is it a bug that it keeps resetting from nothing to 12:08?
iii) If you have to enter a time in some way, is there a simple way of getting it to just return the date (sans time)?

Cheers,

Andrew
Back to the top
 
Posted
Rating:
#52743
Avatar

Hi,

i) No, it's not something we thought of to be honest.
ii) For a non-required date field, it probably will put in the current time in if it's omitted.
iii) In date.php change get_timezoned_date($time); to get_timezoned_date($time,false); and save as sources_custom/hooks/modules/catalogue_fields/date.php (make new dirs as required).
You could probably do it with Tempcode, but it'd be pretty ugly code and make some assumptions about field ID's.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: