File tree Expand file tree Collapse file tree 4 files changed +16
-4
lines changed
Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 1+ ## [ 1.1.3] - 30/09/2019
2+
3+ * Fixed issue with Locale not being initialized
4+
15## [ 1.1.0] - 27/09/2019
26
37* Added Locale option to show date in different language
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import 'package:date_picker_timeline/extra/color.dart';
55import 'package:date_picker_timeline/extra/style.dart' ;
66import 'package:date_picker_timeline/gestures/tap.dart' ;
77import 'package:flutter/material.dart' ;
8+ import 'package:intl/date_symbol_data_local.dart' ;
89
910class DatePickerTimeline extends StatefulWidget {
1011 double width;
@@ -29,14 +30,21 @@ class DatePickerTimeline extends StatefulWidget {
2930 this .selectionColor = AppColors .defaultSelectionColor,
3031 this .daysCount = 50000 ,
3132 this .onDateChange,
32- this .locale,
33+ this .locale = "en_US" ,
3334 }) : super (key: key);
3435
3536 @override
3637 State <StatefulWidget > createState () => new _DatePickerState ();
3738}
3839
3940class _DatePickerState extends State <DatePickerTimeline > {
41+
42+ @override void initState () {
43+ super .initState ();
44+
45+ initializeDateFormatting (widget.locale, null );
46+ }
47+
4048 @override
4149 Widget build (BuildContext context) {
4250 return Container (
Original file line number Diff line number Diff line change @@ -42,11 +42,11 @@ class DateWidget extends StatelessWidget {
4242 mainAxisAlignment: MainAxisAlignment .center,
4343 crossAxisAlignment: CrossAxisAlignment .center,
4444 children: < Widget > [
45- Text (new DateFormat ("MMM" , locale ?? 'en' ).format (date).toUpperCase (), // Month
45+ Text (new DateFormat ("MMM" , locale).format (date).toUpperCase (), // Month
4646 style: monthTextStyle),
4747 Text (date.day.toString (), // Date
4848 style: dateTextStyle),
49- Text (new DateFormat ("E" , locale ?? 'en' ).format (date).toUpperCase (), // WeekDay
49+ Text (new DateFormat ("E" , locale).format (date).toUpperCase (), // WeekDay
5050 style: dayTextStyle)
5151 ],
5252 ),
Original file line number Diff line number Diff line change 11name : date_picker_timeline
22description : Flutter Date Picker Library that provides a calendar as a horizontal timeline.
3- version : 1.1.0
3+ version : 1.1.3
44author : Vivek Kaushik<me@vivekkaushik.com>
55homepage : https://github.com/iamvivekkaushik/DatePickerTimelineFlutter
66
You can’t perform that action at this time.
0 commit comments