//
//  SaleInputTopView.m
//  RealEstateManagement
//
//  Created by Javen on 2016/10/13.
//  Copyright © 2016年 上海勾芒信息科技. All rights reserved.
//

#import "SaleInputTopView.h"

@interface SaleInputTopView ()<UITextFieldDelegate>
@property (strong, nonatomic) UIDatePicker *datePicker;
@end
@implementation SaleInputTopView

- (void)awakeFromNib {
    [super awakeFromNib];
//    if (kUser.isTenant) {
//        self.btnStore.userInteractionEnabled = NO;
//        self.right1.hidden = YES;
//    }
    self.datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(0, 0, kWidth, 216)];
    self.datePicker.maximumDate = [NSDate date];
    self.textFieldDate.inputView = self.datePicker;
    self.textFieldDate.delegate = self;
    self.datePicker.datePickerMode = UIDatePickerModeDate;
    self.textFieldDate.text = [self.datePicker.date yearMonthDayString];
}

- (void)textFieldDidEndEditing:(UITextField *)textField {
    self.textFieldDate.text = [self.datePicker.date yearMonthDayString];
    self.blockDidChooseDate();
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
