【问题标题】:Query based on contain for Date基于包含日期的查询
【发布时间】:2016-11-30 07:58:47
【问题描述】:

我正在尝试根据所选月份和年份查看查询:

我已经选择了声明的日期( //dateselectedStr = "2016-11" )

并且在线数据库中的存储日期包含 updatedAt 相同的 2016-11,我如何根据具有 .contain 搜索查询?这是我的足迹

query.order(byDescending: "updatedAt")
if PFUser.current() != nil {


query.whereKey(CARD_UPDATED_AT, contains: dateselectedStr)

query.findObjectsInBackground { (objects, error)-> Void in
    if error == nil {
        self.recipesArray = objects!
        // Reload CollView
        self.recipesCollView.reloadData()
        let counter = (objects!.count)
        print(counter)
        self.title = "\(counter) JOB CARDS"
        self.hideHUD()

        // Hide/show the nothing found Label
        if self.recipesArray.count == 0 { self.nothingFoundLabel.isHidden = false
        } else { self.nothingFoundLabel.isHidden = true }

    } else {
        self.simpleAlert("\(error!.localizedDescription)")
        self.hideHUD()
}}

【问题讨论】:

    标签: ios swift parse-platform


    【解决方案1】:

    AFAIK,这是唯一可能的解决方案

    2016 年,

    更新时间 >= 01-01-2016 & 更新时间

    一月份,

    updateAt >= 01-01-2016 & updatedAt

    希望这会有所帮助:)

    【讨论】:

      猜你喜欢
      • 2021-11-14
      • 1970-01-01
      • 2012-02-04
      • 2023-03-29
      • 2017-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多