Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[SOLVED] Get Date of Birth in Registration and show additionaly the age in profile

  • artpol
  • artpol
  • OFFLINE
  • Posts: 69
  • Thanks: 5
  • Karma: 1
11 years 7 months ago - 11 years 7 months ago #223386 by artpol
Hi,
i´m newby so sorry if my question might be stupid :-).

I capture the date of birth of a user in his registration process. but i need to show as well his age in his profile view. so as i can only descide to show as age or date of birth i thought that it might be a way to map the date of birth to a new field but i have no idea how to get this achieved even after reading several forum threads.

thanks for your help in advance!
carsten
Last edit: 11 years 7 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
11 years 7 months ago #223395 by krileon
Set the field to display as Age then create a delimiter field and supply it the substitution for that field to render its raw value (date value from database) that way you can have both displays in two separate fields (e.g. substitution [cb_birthdate]). Please see the below tutorial regarding substitution usage.

www.allmysocials.com/directory/tutorials/item/233-substitution-usage


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • artpol
  • artpol
  • OFFLINE
  • Posts: 69
  • Thanks: 5
  • Karma: 1
11 years 7 months ago #223405 by artpol
Thanks,
i already read about these substitiution method but i don´t understand eg for the delimitered field where to add the substitiution. There is no logic place to add substitiutions when i create a new filed. so as this is not covered in the article i have no idea how to substitute :-)
thanks
carsten

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
11 years 7 months ago #223409 by krileon

but i don´t understand eg for the delimitered field where to add the substitiution.

When creating your delimiter field you'll see a parameter called "Description/"i" field-tip: text or HTML:" and this is where you'll supply your substitution (e.g. [cb_birthdate]).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • artpol
  • artpol
  • OFFLINE
  • Posts: 69
  • Thanks: 5
  • Karma: 1
11 years 7 months ago #223413 by artpol
Thanks!
Great now i followed your suggestion and changed the format to age for the caturing field and raw for the delimiter. Two problems are left :-)
1. date is like [format=Y-m-d" /] formated but i need to change this to [format=d-m-Y" /] before output. I played around but could not achive a change for the output.
2. The delimitered fields seems not to be searchable. so is there another type of field that can also be searched within the listview eg for moderators ?
thanks in advance!
carsten

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
11 years 7 months ago #223415 by krileon
When using [cb_birthday] type substitutions it's always raw display from database so no formatting will apply to it. Unfortunately you can't have the formatted date and the age display at the same time. You could use CB Query Field though to query for the date field and that'll at least let you use SQL functions to format the date as you're wanting.

2. The delimitered fields seems not to be searchable. so is there another type of field that can also be searched within the listview eg for moderators ?

You can't search calculated fields such as the delimiter field and a few others. Search should work fine on the date field though regardless of it being set to age display or not.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum