Support » Plugin: Participants Database » Date of BIrth and Age Searchability

  • Resolved cvc1968

    (@cvc1968)


    Hi.
    First, great plugin. For my needs it is 95% what I needed to replace an old Filemaker Pro Talent Database. The only thing missing is the ability to handle Birthdate or age searches.

    In the old system, we collected Date of Birth rather than asking a person’s age. Then we used a calculation field to calculate the person’s age so that it would always be correct as time went on. We were also able to search for a date range or age range in order to cast specific roles.

    With PD, the first thing I’m a bit confused about is the way our Date of Birth is stored. In my CSV, all DoB’s were formatted like this: 01/02/2001, but it displays in both the backend and the various shortcodes as January 2, 2001. Browsing the database I see Unix Timestamps.

    So far, every attempt I’ve made to filter or search the date_of_birth field has failed. I have strict date format disabled in settings. I followed these instructions from your site: Date values should be a regular date string like this: [pdb_list filter=’date>jan1,2000′] but it shows me everything. And I’ve tried numerous searches in the front end search form, but they all result in no records found. Even tried just searching for “March” with strict search off and nothing.

    My first question, then, is to determine if it is possible to set up a calculation field: and Age field that will calculate the age based on the date_of_birth field. Then, this would be searchable or filterable for specific ages or age ranges.

    AND/OR how do I search or filter a date field? I also tried filter=”date_of_birth>01/01/2000′ which also shows everything. I also tried filtering using unix timestamps with the same result. Ideally I’d like to be able to do a front end search of a date range. But I’d also be ok with being able to create multiple pages, each with a list that was filtered for a different age range which can be accessed via a menu I would create.

    Is any of this possible to accomplish?

    Thanks.

    http://wordpress.org/plugins/participants-database/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author xnau webdesign

    (@xnau)

    It’s not clear from your post whether you are using the American or British date convention, but I will say that working with numeric dates with slashes are troublesome. If you go to a text-type formatting for your dates, it will go much more smoothly. This is set in your general settings for the site.

    What you want to do with the lists showing only date ranges is possible, but probably not with the numeric slash representations.

    Plugin Author xnau webdesign

    (@xnau)

    It’s important to note that this has been tested and and it works, but it’s not very sophisticated. In the search, it will only match an exact date. I tested defining date ranges (even using British m/d/Y format) in the shortcode filter, and that works fine.

    Now, as to why it’s not working for you…do you have your general date settings for the site set to the date format you want to use in the plugin?

    Thread Starter cvc1968

    (@cvc1968)

    So after reading your responses, I checked the site’s General settings…it WAS set to display date like this: September 13, 2013. Problem was that I was following your site’s instructions too literally. [pdb_list filter=’date_of_birth>jan1,2000′] did not work, but [pdb_list filter=’date>January 1, 2000′] does. I also tried changing the site to display dates as 09/13/2013 (American way) and then a filter setting like this: [pdb_list filter=’date>01/01/2000′] worked as well. All is good with shortcode filtering.

    As for the front-end search…I can manage without it, but it would be a nice addition sometime down the road. In Filemaker it looked like this:
    01/01/2000...12/31/2002
    If it was the same as the shortcode filter syntax, would that be easier to implement?
    As in:
    >January 1, 2000&<December 31, 2002

    I’d even be happy if it had to be entered exactly like the shortcode:
    date_of_birth>January 1, 2000&date_of_birth<December 31, 2002
    I could provide instruction to my limited number of users in how search with that syntax.

    Anyway, regardless of what, if anything, you come up with, this is a great plugin.

    Plugin Author xnau webdesign

    (@xnau)

    Thanks, glad you found it works. The frontend search is rudamentary, I know, because I had to keep it simple for reasons of practicality. There are just too many permutations when it comes to search design, that I knew I couldn’t accommodate everyone’s needs.

    As it stands, and in the next release, doing something like you suggest requires some custom code. I’ve made this easy with API hooks and user templates, but coding still necessary. Something like what you suggest is pretty simple to implement and if you’ve got a little PHP under your belt, I can point the way.

    Thread Starter cvc1968

    (@cvc1968)

    I did look into possibly writing my own search form to replace your search function, but ultimately found a solution that will work ‘good enough’ for my casting people. I simply created a collection of pages — duplicates of the Actor/Model list, but with the some additional date of birth filters to create lists by decade of birth (i.e. 1971-1980, etc). Then created a menu that appears a the top of all the list pages allowing selection of a decade if desired. It narrows the choices sufficiently for our purposes.

    I am looking forward to you next release, and I may revisit the idea of revising the search form once I’ve had a look at your new API hooks and templates.

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Date of BIrth and Age Searchability’ is closed to new replies.