Skip to content
Snippets Groups Projects
Commit 380b51de authored by poka's avatar poka
Browse files

feat: add real date of certifications

parent c7b4f396
No related branches found
Tags v0.1.7+78
No related merge requests found
Pipeline #36878 failed
......@@ -68,11 +68,16 @@ const String getCertsReceived = r'''
query ($address: String!) {
certConnection(
where: {receiver: {accountId: {_eq: $address}}}
orderBy: {updatedOn: DESC}
) {
edges {
node {
isActive
createdOn
updatedIn {
block {
timestamp
}
}
issuer {
accountId
name
......@@ -87,11 +92,16 @@ const String getCertsSent = r'''
query ($address: String!) {
certConnection(
where: {issuer: {accountId: {_eq: $address}}}
orderBy: {updatedOn: DESC}
) {
edges {
node {
isActive
createdOn
updatedIn {
block {
timestamp
}
}
receiver {
accountId
name
......
......@@ -18,6 +18,10 @@ class CertsList extends StatelessWidget {
final String address;
final CertDirection direction;
String formatNumber(int number) {
return number < 10 ? '0$number' : '$number';
}
@override
Widget build(BuildContext context) {
final indexerProvider = Provider.of<DuniterIndexer>(context, listen: false);
......@@ -81,9 +85,12 @@ class CertsList extends StatelessWidget {
}
final String issuerAddress = cert[certFrom]['accountId'];
final String issuerName = cert[certFrom]['name'];
final date = DateTime.parse('2024-02-04T21:20:54.001+00:00');
final date =
DateTime.parse(cert['updatedIn']['block']['timestamp']);
final dp = DateTime(date.year, date.month, date.day);
final dateForm = '${dp.day}-${dp.month}-${dp.year}';
final dateForm =
'${formatNumber(dp.day)}-${formatNumber(dp.month)}-${dp.year}';
// Check if we have a more recent certification, we skip
if (!listCerts.any((cert) => cert['address'] == issuerAddress)) {
......
......@@ -2,7 +2,7 @@ name: gecko
description: Pay with G1.
publish_to: "none"
version: 0.1.7+77
version: 0.1.7+78
environment:
sdk: ">=2.12.0 <3.0.0"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment