//
//  NSDate+ReactDateFormatter.m
//  rainbow
//
//  Created by Doha Tubaileh on 9/30/19.
//  Copyright © 2019 Facebook. All rights reserved.
//

#import "NSDate+ReactDateFormatter.h"

@implementation NSDate (ReactDateFormatter)

//convert NSDate to string react format
-(NSString*)changeDateFormatToReact {
    if (self != nil) {
        NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
        [dateFormatter setDateFormat:@"EEE MMM dd hh:mm:ss yyyy"];
        NSString *newDate = [dateFormatter stringFromDate:self];
        return newDate;
    }
    return @"";
}

@end
