Comments (7)
Also you be nice to have time along with the date.
from tweet_ui.
Nice catch. Will try to fix it ASAP ;-)
from tweet_ui.
Fixed in version 1.1.0 :-) I also added time to the byline (for now only 24H format).
from tweet_ui.
I made this change for 12hr time since I needed it.
changed tweet_vm.dart
added a createdAtTime: _createdAtTime(tweet), to the tweetvm model
and the method
static String _createdAtTime(Tweet tweet) {
DateFormat twitterFormat = new DateFormat("EEE MMM dd HH:mm:ss '+0000' yyyy");
final dateTime = twitterFormat.parseUTC(tweet.createdAt).toLocal();
DateFormat displayFormatTime = new DateFormat("h:mm a");
return displayFormatTime.format(dateTime);
}
and for byline.dart added a row for the date with time
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Text(
tweetVM.createdAt,
style: userScreenNameStyle,
textAlign: TextAlign.start,
softWrap: false,
),
Text(
" • " + tweetVM.createdAtTime,
style: userScreenNameStyle,
textAlign: TextAlign.start,
)]))])
]);
from tweet_ui.
Nice. Will try to add some configuration for this in the next release ;-)
from tweet_ui.
Oops I just realized even the Date displayed in your code is not correct for the users local timezone as well.
A tweet with created_at = "Sat Feb 22 04:39:00 +0000 2020" where my local timezone is -5h from this time. That means its 11:39PM on Sat Feb 21 my local time. Your code displays "Sat Feb 22"
Had to include the .toLocal() in your function to ensure the date is adjusted to my local date of the tweet. That way, when I click on the tweet and it jumps to twitter.com, the date matches with what twitter displays.
static String _createdAt(Tweet tweet) {
DateFormat twitterFormat = new DateFormat("EEE MMM dd HH:mm:ss '+0000' yyyy");
DateFormat displayFormat = new DateFormat("MM.dd.yyyy");
final dateTime = twitterFormat.parseUTC(tweet.createdAt).toLocal();
return displayFormat.format(dateTime);
}
from tweet_ui.
👍 Will check it this week with a PR that is pending from another user ;)
from tweet_ui.
Related Issues (20)
- type 'Null' is not a subtype of type 'double' HOT 15
- Autoplay videos HOT 2
- The data field is an array, but only one TweetView is generated HOT 1
- Should be fixed deprecated method
- Cached images
- Add support for videos in V2 api
- Update photo_view dependency to 0.14.0 HOT 3
- Duplicate classes when compiling HOT 9
- Incompatible with Flutter v2.5.0 HOT 3
- How to create the json file
- Running the example HOT 3
- How to generate the json file HOT 1
- Displaying a list of tweets using JSON HOT 14
- Support Twitter v2 API
- Enable more platforms HOT 2
- Update dependencies HOT 1
- Support for twitter payload V2. HOT 10
- Can't display a single tweet HOT 8
- Tweet with video doesn't show the video HOT 9
- Add the option to show the 'reply_count' on a tweet widget. HOT 1
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 tweet_ui.