[SOLVED] Date fields get today's date as default?

7 years 2 weeks ago - 7 years 5 days ago #293149 by bilal.abdeen
Thank you for the excellent extension... :)

I have an OPTIONAL date field for the user's birth date.

Q1. I wanted this field to have the default value of NULL. In other words, if the user does not enter anything, it should be EMPTY in the database. Is this possible? If I leave the (Default Registration Value) empty, it shows (1/1/1970) by default on the frontend. If the user decides to ignore filling this field because it is optional, we will have a wrong value of (1/1/1970) stored in the database.

Q2. I am using the plugin (CB Connect). When the social network does not provide a value for this date field, it seems that today's date is stored in the database. How can I avoid that? Even if I enter a default value in field (Default Registration Value), my default value is ignored and today's date in stored in the database. Obviously, it is very confusing to store today's date.

Thank you for your effort and time to help... :) ...

Please Log in to join the conversation.

7 years 2 weeks ago #293178 by krileon

Q1. I wanted this field to have the default value of NULL. In other words, if the user does not enter anything, it should be EMPTY in the database. Is this possible? If I leave the (Default Registration Value) empty, it shows (1/1/1970) by default on the frontend. If the user decides to ignore filling this field because it is optional, we will have a wrong value of (1/1/1970) stored in the database.

If it's set as not required it should default display as empty and allow storing as empty. If you have it marked required it's not possible for it to be empty. It won't store as null, but as 0000-00-00.

Q2. I am using the plugin (CB Connect). When the social network does not provide a value for this date field, it seems that today's date is stored in the database. How can I avoid that? Even if I enter a default value in field (Default Registration Value), my default value is ignored and today's date in stored in the database. Obviously, it is very confusing to store today's date.

There is no code in CB Connect to map todays date if a field is empty. CB Connect has no idea it's even a date field. It simply maps whatever value the social site provided to the field you selected by directly setting it in the user object.


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 to join the conversation.

7 years 2 weeks ago #293208 by bilal.abdeen
Thank you for your effort and time in trying to help me... :)

I have the following settings.
  1. Required: Not Required
  2. Default Registration Value: (EMPTY - nothing is written in this field)

This is what happens when the user visits the cb-registration page. What am I missing?
Date is already filled in with today's date.

Please Log in to join the conversation.

7 years 2 weeks ago - 7 years 2 weeks ago #293219 by krileon
The below is what date and datetime fields that are marked not required look like on registration.



What do you have "Calendar Type" set to within CB > Configuration? If already set to default drop-down usage then something maybe modifying your date field dropdowns and selecting a value.


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.
Attachments:

Please Log in to join the conversation.

7 years 2 weeks ago #293220 by krileon
Ok, was able to confirm a bug with "Popup Calendar, with Input" and "Popup Calendar, without Input" usages not properly ignoring empty value. Using either of the drop-down usages won't have this issue. Have added bug ticket to fix.

forge.joomlapolis.com/issues/6587

Note this has nothing to do with CB Connect and is a bug in CBs calendar 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 to join the conversation.

7 years 2 weeks ago #293232 by bilal.abdeen
Thanks. According to the bug ticket, the problem is resolved. I have just downloaded the latest release.Following is what it says on my website. However, the problem does not appear to be resolved. Please, advise.

Your version is: 2.1.2+build.2017.04.14.15.08.41.3bf553c4c

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.234 seconds

Facebook Twitter LinkedIn