All Projects → CXTretar → CXDatePickerView

CXTretar / CXDatePickerView

Licence: MIT license
一个自定义的日期时间选择器

Programming Languages

objective c
16641 projects - #2 most used programming language
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to CXDatePickerView

Brpickerview
BRPickerView 封装的是iOS中常用的选择器组件,主要包括:日期选择器(支持年月日、年月等15种日期样式选择,支持设置星期、至今等)、地址选择器(支持省市区、省市、省三种地区选择)、自定义字符串选择器(支持单列、多列、二级联动、三级联动选择)。支持自定义主题样式,适配深色模式,支持将选择器组件添加到指定容器视图。
Stars: ✭ 2,149 (+3366.13%)
Mutual labels:  date, pickerview
Mdatepickerview
Quick and easy date picker.
Stars: ✭ 373 (+501.61%)
Mutual labels:  date, pickerview
LGApplications
个人小demo集合:①ActionSheet; ②PickerView; ③ScrollView嵌套; ④渐变文字Label; ⑤tableView实现单选;
Stars: ✭ 36 (-41.94%)
Mutual labels:  pickerview
PSCityPickerView
城市选择器,可以选择国内所有的城市和地区
Stars: ✭ 47 (-24.19%)
Mutual labels:  pickerview
rutimeparser
Recognize date and time in russian text and return datetime.datetime.
Stars: ✭ 17 (-72.58%)
Mutual labels:  date
kubernetes-scheduling-examples
Walk-through guide of advanced scheduling concepts in Kubernetes
Stars: ✭ 38 (-38.71%)
Mutual labels:  pod
go-systemd-time
📅 Go implementation of systemd relative time adjustments
Stars: ✭ 21 (-66.13%)
Mutual labels:  date
QuickWebKit
A great & strong plugin based WebViewController. 一款基于插件的 WebView 视图控制器,您可以基于它设计您的浏览器插件,然后像积木一样来组装它们。
Stars: ✭ 29 (-53.23%)
Mutual labels:  pod
dt
Go's missing DateTime package
Stars: ✭ 34 (-45.16%)
Mutual labels:  date
qrono
🕥 Just right date time library
Stars: ✭ 111 (+79.03%)
Mutual labels:  date
AreaPickerView
areapicker in china, easy to use. 中国的地区选择器.简单易用.
Stars: ✭ 32 (-48.39%)
Mutual labels:  pickerview
jquery-date-dropdowns
A simple, customisable jQuery datepicker plugin to dynamically generate separate "day", "month" and "year" dropdowns, and provide a formatted date string for form submission
Stars: ✭ 42 (-32.26%)
Mutual labels:  date
current-date
The current date, nothing else
Stars: ✭ 14 (-77.42%)
Mutual labels:  date
hs-hourglass
efficient and simpler time API for haskell
Stars: ✭ 43 (-30.65%)
Mutual labels:  date
silverware-calendar
SilverWare Calendar Module
Stars: ✭ 15 (-75.81%)
Mutual labels:  date
vue-translated
Internationalization (i18n) and localization (l10n) library for Vue.js v2.
Stars: ✭ 19 (-69.35%)
Mutual labels:  date
rn-date-range
date picker component for react native
Stars: ✭ 16 (-74.19%)
Mutual labels:  date
GQImageVideoViewer
仿微信多图片及视频浏览器,图片和视频原尺寸显示,不会变形,双击图片放大缩小,单击消失,支持多张本地和网络图片以及网络视频混合查看,支持链式调用
Stars: ✭ 57 (-8.06%)
Mutual labels:  pod
format-date
📆 A small library (around 400 B when gziped & minified) to format JavaScript `Date` object using same tokens as moment.
Stars: ✭ 25 (-59.68%)
Mutual labels:  date
shamsi date
A Flutter and Dart package for using Jalali (Shamsi, Solar, Persian or Jalaali) calendar. You can convert, format and manipulate Jalali and Gregorian (Miladi) date and times.
Stars: ✭ 59 (-4.84%)
Mutual labels:  date

CXDatePickerView

Update【更新】

version: 0.2.5

  • 修复iOS 14 闪退Bug。
  • 增加了选中日期的字体和颜色自定义功能。
  • 增加了日期单位的三种显示风格。
  • 修复了日期单位文本的字体和颜色自定义功能。

Install【安装】

在Podfile文件中添加 pod 'CXDatePickerView', '~> 0.2.2',并运行 pod install

Usage【使用】

  • import【导入框架】 #import "CXDatePickerView.h"

  • init【创建选择器】

/**
 默认滚动到当前时间
 */
- (instancetype)initWithDateStyle:(CXDatePickerStyle)datePickerStyle completeBlock:(void(^)(NSDate *date))completeBlock;


/**
 滚动到指定的的日期
 */
- (instancetype)initWithDateStyle:(CXDatePickerStyle)datePickerStyle scrollToDate:(NSDate *)scrollToDate completeBlock:(void(^)(NSDate *date))completeBlock;


/**
  定制天时分选择器
 */
- (instancetype)initWithZeroDayCompleteBlock:(void(^)(NSInteger days,NSInteger hours,NSInteger minutes))completeBlock;
  • style【选择器样式】
/**
 *  弹出日期类型
 */
typedef NS_ENUM(NSUInteger, CXDatePickerStyle) {
    CXDateYearMonthDayHourMinuteSecond = 0, //年月日时分秒
    CXDateYearMonthDayHourMinute,           //年月日时分
    CXDateMonthDayHourMinute,               //月日时分
    CXDateYearMonthDay,                     //年月日
    CXDateDayHourMinute,                    //日时分
    CXDateYearMonth,                        //年月
    CXDateMonthDay,                         //月日
    CXDateHourMinuteSecond,                 //时分秒
    CXDateHourMinute                        //时分
};

/**
 *  弹出日期单位显示类型
 */
typedef NS_ENUM(NSUInteger, CXDateLabelUnitStyle) {
    CXDateLabelUnitFixed = 0,              // 添加固定位置的日期单位
    CXDateLabelTextAllUnit,                // 添加所有日期的日期单位
    CXDateLabelTextSelectUnit,             // 添加选中日期的日期单位
};

  • custom【自定义属性】
/**
 *  日期单位样式
 */
@property (nonatomic, assign) CXDateLabelUnitStyle dateLabelUnitStyle; // 默认0.25

/**
 *  弹出动画时间
 */
@property (nonatomic, assign) CGFloat showAnimationTime; // 默认0.25

/**
 *  展示时背景透明度
 */
@property (nonatomic, assign) CGFloat shadeViewAlphaWhenShow; //默认0.5

/**
 *  头部视图背景颜色
 */
@property (nonatomic, strong) UIColor *headerViewColor; // 默认白色
/**
 *  头部标题颜色
 */
@property (nonatomic, strong) UIColor *headerTitleColor;
/**
 *  头部标题文字
 */
@property (nonatomic, copy) NSString *headerTitle;
/**
 *  头部标题字体
 */
@property (nonatomic, strong) UIFont *headerTitleFont;
/**
 *  确定按钮颜色
 */
@property (nonatomic, strong) UIColor *doneButtonColor;
/**
 *  确定按钮文字
 */
@property (nonatomic, copy) NSString *doneButtonTitle;
/**
 *  确定按钮字体
 */
@property (nonatomic, strong) UIFont *doneButtonFont;
/**
 *  取消按钮颜色
 */
@property (nonatomic, strong) UIColor *cancelButtonColor;
/**
 *  取消按钮文字
 */
@property (nonatomic, copy) NSString *cancelButtonTitle;
/**
 *  取消按钮字体
 */
@property (nonatomic, strong) UIFont *cancelButtonFont;

/**
 *  年-月-日-时-分 单位文字颜色(默认橙色)
 */
@property (nonatomic, strong) UIColor *dateUnitLabelColor;
/**
 *  年-月-日-时-分 单位文字字体(默认 [UIFont systemFontOfSize:15])
 */
@property (nonatomic, strong) UIFont *dateUnitLabelFont;
/**
 *  滚轮日期选中颜色(默认橙色)
 */
@property (nonatomic, strong) UIColor *datePickerSelectColor;
/**
 *  滚轮日期选中字体
 */
@property (nonatomic, strong) UIFont *datePickerSelectFont;
/**
 *  滚轮日期颜色(默认黑色)
 */
@property (nonatomic, strong) UIColor *datePickerColor;
/**
 *  滚轮日期字体
 */
@property (nonatomic, strong) UIFont *datePickerFont;
/**
 *  限制最大时间(默认2099)datePicker大于最大日期则滚动回最大限制日期
 */
@property (nonatomic, strong) NSDate *maxLimitDate;
/**
 *  限制最小时间(默认0) datePicker小于最小日期则滚动回最小限制日期
 */
@property (nonatomic, strong) NSDate *minLimitDate;

/**
 *  大号年份字体颜色(默认灰色)想隐藏可以设置为clearColor
 */
@property (nonatomic, strong) UIColor *yearLabelColor;

/**
 *  隐藏每行年月日文字
 */
@property (nonatomic, assign) BOOL hideDateNameLabel;

/**
 *  隐藏每行分割线
 */
@property (nonatomic, assign) BOOL hideSegmentedLine;

/**
 *  隐藏背景年份文字
 */
@property (nonatomic, assign) BOOL hideBackgroundYearLabel;

/**
 *  头部按钮视图高度
 */
@property (nonatomic, assign) CGFloat topViewHeight; // 默认44

/**
 *  选择器部分视图高度
 */
@property (nonatomic, assign) CGFloat pickerViewHeight; // 默认200


/**
 *  选择器每行高度
 */
@property (nonatomic, assign) CGFloat pickerRowHeight; // 默认44

  • example【示例】
#pragma mark - 年-月-日-时-分-秒
- (void)showYearMonthDayHourMinuteSecond:(NSIndexPath *)indexPath {
    CXDatePickerView *datepicker = [[CXDatePickerView alloc] initWithDateStyle:CXDateYearMonthDayHourMinuteSecond completeBlock:^(NSDate *selectDate) {
        
        NSString *dateString = [selectDate cx_stringWithFormat:@"yyyy-MM-dd HH:mm:ss"];
        NSLog(@"选择的日期:%@",dateString);
        self.examples[indexPath.row].title = dateString;
        [self.tableView reloadData];
    }];
    datepicker.dateUnitLabelColor = [UIColor orangeColor];//年-月-日-时-分-秒 颜色
    datepicker.datePickerColor = [UIColor blackColor];//滚轮日期颜色
    datepicker.headerViewColor = [UIColor orangeColor]; // 顶部视图背景颜色
    datepicker.doneButtonColor = [UIColor whiteColor]; // 确认按钮字体颜色
    datepicker.cancelButtonColor = [UIColor whiteColor]; // 取消按钮颜色
    datepicker.shadeViewAlphaWhenShow = 0.25;
    datepicker.headerTitle = @"选择日期";
    datepicker.headerTitleColor = [UIColor whiteColor];
    datepicker.minLimitDate = [NSDate cx_date:@"2019-12-1 12:45:00" WithFormat:@"yyyy-MM-dd HH:mm:ss"];
    datepicker.maxLimitDate = [NSDate cx_date:@"2022-12-26 12:45:00" WithFormat:@"yyyy-MM-dd HH:mm:ss"];
    datepicker.datePickerSelectColor = [UIColor orangeColor];
    datepicker.datePickerSelectFont = [UIFont systemFontOfSize:17];
    [datepicker show];
}

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].