sp-date-picker not opening calendar

syoung
Tera Contributor

Hey community.  

I'm playing around in widgets and it seems like the <sp-date-picker is not working.
it appears to be correctly creating the field, but the button will not open.  it doesn't do anything.  There is nothing in the logs as far as errors.
Checking the console logs there is an error.


so just for testing:
i created a BRAND new widget.
The only thing there is  in the HTML:  but make sure there is a preview.  The date field works fine,
The sp-date-picker does not do anything.

<div>
  <div class="date-picker-block">
    <sp-date-picker id="date-picker-field" field="balanceDateField" ng-model="selectedDate"
                    sn-change="gotoDate()"></sp-date-picker>
  </div>
</div>
<br />
<div class="input-date-block">
  <input type="datetime-local" name="date" class="form-control" id="date" ng-model="date" data-date-format="DD MMMM YYYY">
</div>
 
Console log:
this is the error:
syoung_0-1741720737456.png


I was getting this in my PDI,  so i got a brand new PDI.  this is the brand new PDI.

Build: glide-yokohama-12-18-2024__patch0-01-14-2025

Same thing is happening in my work instance on: glide-xanadu-07-02-2024__patch5-12-24-2024

was this function depricated?  or am i doing something wrong?

1 ACCEPTED SOLUTION

DrewW
Mega Sage
Mega Sage

This is the code that works for us for a date picker

HTML

 

<sp-date-picker 
              field="datePicker"
              name="datePickerControl"
              sn-include-time="false"
              ng-model="datePicker.value"
              >
</sp-date-picker>

 

 

Client Controler

 

$scope.datePicker = {
	value: c.data.currentDate,
	name: 'datePicker'
};

$scope.$watch("datePicker.value", function(newValue, oldValue) {	
	if(newValue == oldValue)
		return;

//Do other work here.
		
});

 

 

 

View solution in original post

2 REPLIES 2

DrewW
Mega Sage
Mega Sage

This is the code that works for us for a date picker

HTML

 

<sp-date-picker 
              field="datePicker"
              name="datePickerControl"
              sn-include-time="false"
              ng-model="datePicker.value"
              >
</sp-date-picker>

 

 

Client Controler

 

$scope.datePicker = {
	value: c.data.currentDate,
	name: 'datePicker'
};

$scope.$watch("datePicker.value", function(newValue, oldValue) {	
	if(newValue == oldValue)
		return;

//Do other work here.
		
});

 

 

 

MattHarris
Tera Contributor

I have attempted this myself, however I can not get it to work either:

 

2025-07-24 10_26_34-Editing_ date-picker — Mozilla Firefox.png

 

Am i missing something?