mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-09-14 15:33:17 +08:00

This reverts commit 303192d9d575b26a77a00f7a62212f310ec1e329. This reverts commit cd9d128b47ed523036f7ae1232ec7adcf04ed8a9. GitJournal is used by non-English speakers (a lot in China and Russia) and while we don't support those languages completely, we do support them a little bit. I don't want to loose this functionality. It would be better for us to fix the bug in intl.
54 lines
1.2 KiB
Dart
54 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:intl/intl.dart';
|
|
import 'package:gitjournal/core/note.dart';
|
|
|
|
class JournalEditorHeader extends StatelessWidget {
|
|
final Note note;
|
|
|
|
JournalEditorHeader(this.note);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
if (note.created == null) {
|
|
return Container();
|
|
}
|
|
var dateStr = DateFormat('MMMM, yyyy').format(note.created);
|
|
var timeStr = DateFormat('EEEE HH:mm').format(note.created);
|
|
|
|
var bigNum = Text(
|
|
note.created.day.toString(),
|
|
style: const TextStyle(fontSize: 40.0),
|
|
);
|
|
|
|
var dateText = Text(
|
|
dateStr,
|
|
style: const TextStyle(fontSize: 18.0),
|
|
);
|
|
|
|
var timeText = Text(
|
|
timeStr,
|
|
style: const TextStyle(fontSize: 18.0),
|
|
);
|
|
|
|
var w = Row(
|
|
children: <Widget>[
|
|
bigNum,
|
|
const SizedBox(width: 8.0),
|
|
Column(
|
|
children: <Widget>[
|
|
dateText,
|
|
timeText,
|
|
],
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
),
|
|
],
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
);
|
|
|
|
return Padding(
|
|
padding: const EdgeInsets.only(top: 8.0, bottom: 18.0),
|
|
child: w,
|
|
);
|
|
}
|
|
}
|