SHARE
TWEET

Untitled

a guest Jun 26th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Aqui capturo la fecha, esta puesta la variable como Date
  2. private recogerFecha(value: Date) {
  3.     this.setState({
  4.       FechaBriefCampanya: value
  5.     });
  6.  
  7.   }
  8.  
  9. //M├ętodo por el que filtro
  10. private async getCampaign(): Promise<any[]> {
  11.  
  12.     let cadFechaInicio = "<Leq><FieldRef Name='CampoFechaInicio' /><Value Type='DateTime'>" + this.state.FechaInicio.toISOString().split('T')[0] + "</Value></Leq>";
  13.     let cadFechaFin = "<Geq><FieldRef Name='CampoFechaFin' /><Value Type='DateTime'>" + this.state.FechaFin.toISOString().split('T')[0] + "</Value></Geq>";
  14.  
  15.  
  16.     console.log(cadFechaInicio);
  17.     console.log(cadFechaFin);
  18.  
  19.     let listItems = await sp.web.lists.getByTitle('NombreLista').getItemsByCAMLQuery(
  20.       {
  21.         ViewXml:
  22.           "<View><Query><Where>" + cadFechaInicio + cadFechaFin + "</Where></Query></View>"
  23.       }
  24.     );
  25.     console.log(listItems);
  26. }
  27.      
  28. <DatePicker firstDayOfWeek={DayOfWeek.Monday} strings={DayPickerStrings} showWeekNumbers={false} firstWeekOfYear={1} showMonthPickerAsOverlay={true}
  29.             value={this.state.FechaBriefCampanya} onSelectDate={this.recogerFecha} formatDate={this._onFormatDate} />
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top