Welcome

首页 / 脚本样式 / Element UI / 处理elementui日期选择器获取的时间

<el-date-picker

                  v-model="value1"

                  type="daterange"

                  size="small"

                  range-separator="to"

                  @change="getSTime"

                  format="yyyy-MM-dd"

                  start-placeholder="Start date"

                  end-placeholder="End date">

                </el-date-picker>


                getSTime(val){

          this.value1=val

         console.log(this.value1[0])

         var d = new Date(this.value1[0]);

         var youWant=d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate();

         console.log(youWant)

         var d2 = new Date(this.value1[1]);

         var youWant2=d2.getFullYear() + '-' + (d2.getMonth() + 1) + '-' + d2.getDate();

         console.log(youWant2)

         this.queryInfo.startDate=youWant

         this.queryInfo.endDate=youWant2

         //

         // console.log(youWant.trim().split(" ")[0])

         // console.log(youWant2.trim().split(" ")[0])



       },