Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Aqui capturo la fecha, esta puesta la variable como Date
- private recogerFecha(value: Date) {
- this.setState({
- FechaBriefCampanya: value
- });
- }
- //Método por el que filtro
- private async getCampaign(): Promise<any[]> {
- let cadFechaInicio = "<Leq><FieldRef Name='CampoFechaInicio' /><Value Type='DateTime'>" + this.state.FechaInicio.toISOString().split('T')[0] + "</Value></Leq>";
- let cadFechaFin = "<Geq><FieldRef Name='CampoFechaFin' /><Value Type='DateTime'>" + this.state.FechaFin.toISOString().split('T')[0] + "</Value></Geq>";
- console.log(cadFechaInicio);
- console.log(cadFechaFin);
- let listItems = await sp.web.lists.getByTitle('NombreLista').getItemsByCAMLQuery(
- {
- ViewXml:
- "<View><Query><Where>" + cadFechaInicio + cadFechaFin + "</Where></Query></View>"
- }
- );
- console.log(listItems);
- }
- <DatePicker firstDayOfWeek={DayOfWeek.Monday} strings={DayPickerStrings} showWeekNumbers={false} firstWeekOfYear={1} showMonthPickerAsOverlay={true}
- value={this.state.FechaBriefCampanya} onSelectDate={this.recogerFecha} formatDate={this._onFormatDate} />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement