Comments (8)
I would second this idea. I did the exact same thing in a project I'm working on right now.
from sspulltorefresh.
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.
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.
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-7106406Regards,
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.
Can you send me a pull request?
from sspulltorefresh.
Hey @ScottLWasserman, could you please use localizedStringFromDate
? Dates are formatted the other way around in other parts of the world :-) Thanks!
from sspulltorefresh.
@samsoffes I will be glad to send you a pull request today)
from sspulltorefresh.
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)
- -pullToRefreshViewDidFinishLoading is called before the animation starts HOT 1
- UITextAlignmentCenter is deprecated in iOS 6.0 HOT 1
- Disable the SSPullToRefresh HOT 3
- Unrecognized selector on iOS6 HOT 1
- Headers in sections glitch when pull to refresh is loading HOT 2
- Animation glitch upon touch release when state == SSPullToRefreshViewStateReady
- iOS 7 HOT 8
- Load repeat records
- sectionIndexTitles jumps up and down when loading
- pull up to load more control
- How to expand manually HOT 1
- Pull progress > 1.0 is not reported. HOT 3
- PullToRefresh view disappeared in iOS 8 when upgraded version to 1.2.2 HOT 4
- Sending 'Notifications_ViewController *const __strong' to parameter of incompatible type 'id<SSPullToRefreshViewDelegate>' HOT 6
- Swift compat? HOT 1
- You continue to rock, Sam Soffes HOT 1
- initWithScrollView:delegate: should call initWithFrame: on super, not self HOT 2
- Trigger refresh with VoiceOver three-finger scroll gesture HOT 1
- Delegate Callback Behavior
- SSPullToRefresh does not work correctly on ios11 if it's compiled with xCode9 HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sspulltorefresh.