Giter VIP home page Giter VIP logo

yldatepicker's Introduction

YLDatePicker

时间选择器(与UIDatePicker的区别是区域之外的时间不显示)

img

希望

  • 如果您在使用时发现错误,希望您可以 Issues 我

  • 如果您发现使用的功能不够,希望您可以 Issues 我

导入

每个项目要求不同,自己把类copy进项目,改成自己想要的样式吧

使用

let datePicker = YLDatePicker(currentDate: nil, minLimitDate: Date(), 						maxLimitDate: nil, datePickerType: .YM) { [weak self] (date) in
                self?.navigationItem.title = date.getString(format: "yyyy-MM")
            }
datePicker.show()

----------------------------------------------------------------------------------------

// 显示时间类型
public enum YLDatePickerType:String {
    case YM      // 年月
    case MD      // 月日
    case YMD     // 年月日
    case YMDHm   // 年月日时分
    case MDHm    // 月日时分
    case Hm      // 时分
}

// 默认最小时间
fileprivate var minLimitDate = Date.init(timeIntervalSince1970: TimeInterval(0)) 
// 默认最大时间
fileprivate var maxLimitDate = Date.init(timeIntervalSince1970: TimeInterval(9999999999)) 
// 首次显示时间(currentDate) 不设置默认当前时间

yldatepicker's People

Contributors

february12 avatar

Stargazers

MohsinAli avatar

Watchers

MohsinAli avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.