I want to use datepicker to save the day as text.

@yisrael-wix Thank your for your replay.
I don’t use repeater on this page.
This page is dynamic page.
Is it still the same?

@nanami Your code has a Repeater onItemReady():

$w("#repeater5").onItemReady(($w,itemData,index)=>{

@yisrael-wix
The repeater is the code to open the lightbox.
This one is working fine.

the datapicker has nothing to do with repeaters and lightboxes, but wants to connect with different database.

import wixWindow from ‘wix-window’ ;

const options = { weekday : ‘long’ , year : ‘numeric’ , month : ‘long’ , day : ‘numeric’ };

$w . onReady (() => {
$w ( “#repeater5” ). onItemReady (( $w , itemData , index ) => {
$w ( “#image272” ). onClick (() => {
const repeaterItem = itemData ;
wixWindow . openLightbox ( “lightbox” , repeaterItem );
});

$w ( ‘#dynamicDataset’ ). onReady (() => {

  $w ( "#dynamicDataset" ). onBeforeSave ( () => { 

     $w ( '#dynamicDataset' ). setFieldValues ({ 
date :  $w ( '#datePicker1' ). value . toLocaleDateString ( 'ja-JP' , options ) 

})

console . log ( “Canceling save” );
return false ;
} );

}) 
}); 
})

@ahmadnasriya
I tried delete the return line.
but the code getting an error.
so I change the code false → true
but nothing save in the date field.

the code is

import wixWindow from ‘wix-window’ ;

const options = { weekday : ‘long’ , year : ‘numeric’ , month : ‘long’ , day : ‘numeric’ };

$w . onReady (() => {
$w ( “#repeater5” ). onItemReady (( $w , itemData , index ) => {
$w ( “#image272” ). onClick (() => {
const repeaterItem = itemData ;
wixWindow . openLightbox ( “lightbox” , repeaterItem );
});

$w ( ‘#dynamicDataset’ ). onReady (() => {

  $w ( "#dynamicDataset" ). onBeforeSave ( () => { 

     $w ( '#dynamicDataset' ). setFieldValues ({ 
date :  $w ( '#datePicker1' ). value . toLocaleDateString ( 'ja-JP' , options ) 

})

console . log ( “Canceling save” );
return true ;
} );

}) 
}); 
})

@nanami
IT’s–> nanami ← again, who makes that much trouble :sweat_smile:

@nanami you should not return anything.

@ahmadnasriya
If I don’t put anything in the return, I get an error.

@nanami What’s the error you’re getting?