TOPIC:

Sync calendar to db 1 week 2 days ago #254481

  • Topic Author
  • ferrari
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 16
  • Thanks: 0
Hi guys,
i need to create a form with a calendar that show available dates through a syncronization with my db. Someone can suggest me some tips ?

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

Sync calendar to db 1 week 2 days ago #254483

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 3785
  • Karma: 3
  • Thanks: 303
Hi,

this is a little hard, but you can use an alternative.
If you are using responsive calendar, then you can disable some dates (dates which you want). I can provide you with the code for this

Regards,
Tihana
The following user(s) said Thank You: ferrari

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

Sync calendar to db 1 week 2 days ago #254485

  • Topic Author
  • ferrari
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 16
  • Thanks: 0
yes pls can you explain better this alternative?

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

Sync calendar to db 1 week 2 days ago #254486

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 3785
  • Karma: 3
  • Thanks: 303
Hi,

here is example how to disable 20.2.2021 and 21.2.2021

1) add responsive calendar to your form
Set format in responsive calendar->Properties->Format for e.g:
yyyy-mm-dd

2)Go to your form->Advanced->More options->Form pieces->Before form->check Custom and put:
echo '<script type="text/javascript">
		JQuery(document).ready(function () {
					
			JQuery("#ff_elem28_calendarButton").pickadate({
				format: "yyyy-mm-dd", 
				selectYears: 60, 
				disable:  [ [2021,1,20], [2021,1,21]] ,
				selectMonths: true,
				editable: true,
				firstDay: 1,
				onSet: function() {JQuery("#ff_elem28").val(this.get("value"));}
			});
                    });
	</script>';
Please replace #ff_elem28 with ID of your calendar->right click to your browser->Inspect and in Console find ID for calendar
Months are shown from 0-11, and that is the reason why February is show as 1 (not as 2).

Regards,
Tihana

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

Last edit: Post by tihana.krivic.

Sync calendar to db 1 week 2 days ago #254489

  • Topic Author
  • ferrari
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 16
  • Thanks: 0
thanks, last question for me. In the disable field can i pass directly an array of dates?

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

Sync calendar to db 1 week 2 days ago #254490

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 3785
  • Karma: 3
  • Thanks: 303
Hi,

disable "field" should be define like:
disable:  [ [2021,1,20], [2021,1,21],  [2021,1,22] ]

Regards,
Tihana

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

  • Page:
  • 1
Time to create page: 0.051 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!