 { spfi } from &quot;@pnp/sp&quot;;
import { DateTimeFieldFormatType, CalendarType, DateTimeFieldFriendlyFormatType } from &quot;@pnp/sp/fields/types&quot;;
import &quot;@pnp/sp/webs&quot;;
import &quot;@pnp/sp/lists&quot;;
import &quot;@pnp/sp/fields&quot;;

const sp = spfi(...);

// create a new date/time field called 'My Field' in web
const field = await sp.web.fields.addDateTime(&quot;My Field&quot;, { DisplayFormat: DateTimeFieldFormatType.DateOnly, DateTimeCalendarType: CalendarType.Gregorian, Friendl