Skip to content

Commit

Permalink
better fix of abstinence
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud AMBROSELLI committed Nov 11, 2024
1 parent 1762f79 commit 6507d02
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
4 changes: 2 additions & 2 deletions expo/app.versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"buildNumber": 315,
"buildName": "1.26.6"
"buildNumber": 316,
"buildName": "1.26.7"
}
2 changes: 1 addition & 1 deletion expo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oz-ensemble",
"version": "1.26.6",
"version": "1.26.7",
"scripts": {
"get-ip": "./get-ip.sh && echo \"this script updates the API IP to your own IP, because that's what Android Emulator needs to work. It's based on your wifi IP, if you need ethernet it won't work (needs en1 instead of en0)\"",
"start": "expo start --dev-client",
Expand Down
10 changes: 5 additions & 5 deletions expo/src/helpers/dateHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ export const isToday = (inputDate) => {
return Date.parse(date) === Date.parse(today());
};

const msInDays = (timestamp) => timestamp / 1000 / 60 / 60 / 24;

export const differenceOfDays = (date1, date2) => {
// Use dayjs to calculate the absolute difference in days
return Math.abs(dayjs(date1).diff(dayjs(date2), "day"));
};
// Convert dates to start of day in local timezone to avoid DST issues
const d1 = dayjs(date1).startOf('day');
const d2 = dayjs(date2).startOf('day');
return Math.abs(d1.diff(d2, 'day'));
};
6 changes: 2 additions & 4 deletions expo/src/scenes/Infos/Transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,12 @@ const Transfer = ({ navigation }) => {
};

try {
await Share.open(shareOptions).then(() => {
(res) => {
await Share.open(shareOptions).then((res) => {
console.log(res);
logEvent({ category: "TRANSFER", action: "EXPORT_DATA_SUCCESS" });
Alert.alert("Vos données ont bien été sauvegardées.");
storage.set("@ExportedData", true);
};
});
});
} catch (error) {
console.log("Error sharing:", error);
Alert.alert("Erreur lors du partage des données.");
Expand Down

0 comments on commit 6507d02

Please sign in to comment.