Giter VIP home page Giter VIP logo

Comments (8)

ScottLWasserman avatar ScottLWasserman commented on September 4, 2024

I would second this idea. I did the exact same thing in a project I'm working on right now.

from sspulltorefresh.

soffes avatar soffes commented on September 4, 2024

Sounds good.

Can you send me a pull request with this? I think showing the time if it's the same day and maybe the date & time if it's not the same day. What do you think?

from sspulltorefresh.

ScottLWasserman avatar ScottLWasserman commented on September 4, 2024

This is what I implemented to accomplish what I needed for date and
time to show up in the last updated text. I just created another
class to override it. Might be nice to be able to have a way to pass
in or set the NSDateFormatter.

  • (void)setLastUpdatedAt:(NSDate *)date
    withPullToRefreshView:(SSPullToRefreshView *)view {
    NSLog(@"Set last updated at : %@", date);
    static NSDateFormatter *dateFormatter = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
    dateFormatter = [[NSDateFormatter alloc] init];
    dateFormatter.dateStyle = NSDateFormatterLongStyle;
    dateFormatter.dateFormat = @"MM/dd/yyyy HH:mm a";

    });
    self.lastUpdatedAtLabel.text = [NSString stringWithFormat:@"Last
    Updated: %@", [dateFormatter stringFromDate:date]];
    }

On Thu, Jul 19, 2012 at 2:16 PM, Sam Soffes
[email protected]
wrote:

Sounds good.

Can you send me a pull request with this? I think showing the time if it's the same day and maybe the date & time if it's not the same day. What do you think?


Reply to this email directly or view it on GitHub:
https://github.com/samsoffes/sspulltorefresh/issues/11#issuecomment-7106406

Regards,
Scott Wasserman
appRenaissance, LLC
Founder & CTO
[email protected]
484.885.6446
800.594.0401

from sspulltorefresh.

ScottLWasserman avatar ScottLWasserman commented on September 4, 2024

Woops that should have been:

dateFormatter.dateFormat = @"MM/dd/yyyy hh:mm a";

On Thu, Jul 19, 2012 at 3:39 PM, Scott Wasserman [email protected] wrote:

This is what I implemented to accomplish what I needed for date and
time to show up in the last updated text. I just created another
class to override it. Might be nice to be able to have a way to pass
in or set the NSDateFormatter.

  • (void)setLastUpdatedAt:(NSDate *)date
    withPullToRefreshView:(SSPullToRefreshView *)view {
    NSLog(@"Set last updated at : %@", date);
    static NSDateFormatter *dateFormatter = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
    dateFormatter = [[NSDateFormatter alloc] init];
    dateFormatter.dateStyle = NSDateFormatterLongStyle;
    dateFormatter.dateFormat = @"MM/dd/yyyy HH:mm a";

    });
    self.lastUpdatedAtLabel.text = [NSString stringWithFormat:@"Last
    Updated: %@", [dateFormatter stringFromDate:date]];
    }

On Thu, Jul 19, 2012 at 2:16 PM, Sam Soffes
[email protected]
wrote:

Sounds good.

Can you send me a pull request with this? I think showing the time if it's the same day and maybe the date & time if it's not the same day. What do you think?


Reply to this email directly or view it on GitHub:
https://github.com/samsoffes/sspulltorefresh/issues/11#issuecomment-7106406

Regards,
Scott Wasserman
appRenaissance, LLC
Founder & CTO
[email protected]
484.885.6446
800.594.0401

Regards,
Scott Wasserman
appRenaissance, LLC
Founder & CTO
[email protected]
484.885.6446
800.594.0401

from sspulltorefresh.

soffes avatar soffes commented on September 4, 2024

Can you send me a pull request?

from sspulltorefresh.

Shukuyen avatar Shukuyen commented on September 4, 2024

Hey @ScottLWasserman, could you please use localizedStringFromDate? Dates are formatted the other way around in other parts of the world :-) Thanks!

from sspulltorefresh.

yas375 avatar yas375 commented on September 4, 2024

@samsoffes I will be glad to send you a pull request today)

from sspulltorefresh.

yas375 avatar yas375 commented on September 4, 2024

I've added time to 'Last updated' field.

I think showing the time if it's the same day and maybe the date & time if it's not the same day. What do you think?

I'm not sure that it should be implemented in a library... I think that it will be more clear if format will be the same forever... Isn't it? And it's a default content view. And as this content view is default and user should inherit from this in some cases, so maybe better to leave it's code simple. Without calendars, date components and other related staff to this feature. Or not?

If you still would like show different formats according to date differences I could implement it on a weekend)

from sspulltorefresh.

Related Issues (20)

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.