Comments (4)
I'll look into this!
I'm not super informed when it comes to time localization, so if someone wants to contribute on this one quicker then me feel free!
from timescroller.
Im doing it this way.
if (dateComponents.year == todayComponents.year && dateComponents.month == todayComponents.month && dateComponents.day == todayComponents.day) {
timeLabelFrame = CGRectMake(30.0f, 4.0f, 100.0f, 20.0f);
dateLabelString = @"";
dateLabelAlpha = 0.0f;
} else if ((dateComponents.year == todayComponents.year) && (dateComponents.month == todayComponents.month) && (dateComponents.day == todayComponents.day - 1)) {
timeLabelFrame = CGRectMake(30.0f, 4.0f, 100.0f, 10.0f);
dateLabelString = NSLocalizedString(@"Yesterday", @"Yesterday");
dateLabelAlpha = 1.0f;
} else if ((dateComponents.year == todayComponents.year) && (dateComponents.weekOfYear == todayComponents.weekOfYear)) {
timeLabelFrame = CGRectMake(30.0f, 4.0f, 100.0f, 10.0f);
dateLabelString = [self.dayOfWeekDateFormatter stringFromDate:date];
dateLabelAlpha = 1.0f;
} else if (dateComponents.year == todayComponents.year) {
timeLabelFrame = CGRectMake(30.0f, 4.0f, 100.0f, 10.0f);
dateLabelString = [self.monthDayDateFormatter stringFromDate:date];
dateLabelAlpha = 1.0f;
} else {
timeLabelFrame = CGRectMake(30.0f, 4.0f, 100.0f, 10.0f);
dateLabelString = [self.monthDayYearDateFormatter stringFromDate:date];
dateLabelAlpha = 1.0f;
}
CGFloat timeWidth = [timeLabelString sizeWithFont:_timeLabel.font].width;
CGFloat dateWidth = [dateLabelString sizeWithFont:_dateLabel.font].width;
CGFloat width = ( timeWidth > dateWidth ? timeWidth : dateWidth) + 40.0f;
backgroundFrame = CGRectMake(CGRectGetWidth(self.frame) - width, 0.0f, width, CGRectGetHeight(self.frame));
from timescroller.
@honkmaster It's been a while, but if you'd like to submit those changes as a pull request I'd be happy to check them out and merge them in! I've recently changed up the project a bit, but it's nothing that shouldn't take more than a few minutes to sync up with!
from timescroller.
I will see what i can do and submit a pull request in the next days,
from timescroller.
Related Issues (20)
- clock handle and time label are not in sync all the time. HOT 1
- problem if the numbers of rows <10 HOT 3
- timeScroller won't work if rows could not full fill at least one page HOT 6
- Hands in the clock not moving, though the time in the text is right HOT 3
- device orientation support & number of rows changes HOT 2
- Switching View Controllers causes TimeScroller to "Multiply" HOT 8
- resizableImageWithCapInsets works on ioS5 only HOT 3
- Timescroller doesnt update when tableview has new rows HOT 2
- CocoaPod release version out-of-date HOT 3
- How to add this to a uiscrollview? HOT 1
- iOS7 Support HOT 9
- Not working on iPad iOS5 HOT 13
- iOS 7 redesign HOT 2
- TimeScroller is broken on iOS 8.1 HOT 6
- Time scroller not visible in plus size and iPhone X device models.
- ARC Compatibility HOT 1
- ARC Support HOT 1
- Please add semantic version tags. HOT 1
- some strange question HOT 2
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 timescroller.