Skip to Content Skip to Menu

Insert current date in a field

  • m2
  • m2
  • OFFLINE
  • Posts: 3
  • Thanks: 1
  • Karma: 1
2 years 6 months ago #329312 by m2
Insert current date in a field was created by m2
Hi,
thank you in advance for your help and apologize for my English.
In the 2018 we bought the “Professional Membership” of "Community Builder" (version 2.4.1) and we use it, successfully, in this environment:
• CB 2.4.1
• PHP 7.3.6
• Joomla 3.9.4
• MSQL 5.7.31

Unfortunately, we cannot change anything because we use an environment provided by my university. So it is not possible to update PHP, DB, Joomla or CB.

Question 1:
I use a CB Field Groups to create a form for the insertion of job offers from companies for the students of my university.
In this form, I would like to insert a field (read-only) that stores the saving date of the job offer entered.
I tried reading the documentation and the forum but couldn't find an answer.
I tried to use a CB Code Field, with PHP code. The field correctly shows the current date, but this field is NOT saved in the database (I have read that this is the correct functioning of a CB Code Field).
Is there any way to do this?


QUESTION 2
In a "date" field it is possible to make it so that the user CANNOT choose dates prior to the current date (eg. if the current date is 2022/05/07 the user can only choose a date equal to or greater than 2022/ 05/07).
It's possible to do it?

In any case, thanks for the help
M

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
2 years 6 months ago - 2 years 6 months ago #329336 by krileon
Replied by krileon on topic Insert current date in a field

• PHP 7.3.6

CB requires a minimum of PHP 7.4. So you won't be able to install latest releases with your environment. I recommend trying to get them to at least update to 7.4.

www.joomlapolis.com/documentation/276-community-builder/getting-started/18576-technical-requirements-for-community-builder

Question 1:

I cannot answer questions regarding paid products without an active subscription, sorry. Please renew and post in the support forums.

QUESTION 2

No, you can only restrict the year without using something like CB Code Field and its Code Validation to add custom PHP based validation to the date field.


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.
Last edit: 2 years 6 months ago by krileon.

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

  • m2
  • m2
  • OFFLINE
  • Posts: 3
  • Thanks: 1
  • Karma: 1
2 years 6 months ago #329365 by m2
Replied by m2 on topic Insert current date in a field
Dear Krileon,

thanks for your replies.

PHP 7.4
we have already asked to upgrade to PHP 7.4. but, for the moment, it is not possible (but I hope for the future)

Question 1:
I just want to know if it is possible to insert the current date in a field with CB version 2.4.1. If possible, I try to convince the project manager to buy the paid version to get your support and solve this problem.


finally, thanks for the answer to QUESTION 2

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
2 years 6 months ago #329380 by krileon
Replied by krileon on topic Insert current date in a field

I just want to know if it is possible to insert the current date in a field with CB version 2.4.1. If possible, I try to convince the project manager to buy the paid version to get your support and solve this problem.

You can use the date substitution in a Custom HTML field to output current datetime in whatever PHP date format you like. See the substitution tutorial below for usage information.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb

If you need to keep track of when a fields value has changed you'd need CB Auto Actions for that, but it maybe very complicated if you're needing to do this individually for each field groups field row. I guess one strange way to do it is a Code Select field that outputs only 1 selection option and that'd be the current datetime so something can be stored. Regular Code fields have no storage which is why that's not working for you.

I can't really provide any further guidance or examples, sorry, as they're both paid products and would require an active subscription for me to go into further detail.


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.

  • m2
  • m2
  • OFFLINE
  • Posts: 3
  • Thanks: 1
  • Karma: 1
2 years 6 months ago #329386 by m2
Replied by m2 on topic Insert current date in a field
Dear Krileon

thanks a lot for your suggestions ...

I understand that you need a paid subscription for further help.

I try to speak to the project manager ...

good karma !!!
M
The following user(s) said Thank You: krileon

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

Moderators: beatnantkrileon
Powered by Kunena Forum