Skip to content

Commit

Permalink
fix UTC year issue for display over year boundary dates
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-verida committed Jan 2, 2024
1 parent 18b4eaf commit 5ea2eb7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/components/SearchInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import { defineComponent } from "vue";
import { mapActions, mapState, mapMutations } from "vuex";
import { useField, useForm } from "vee-validate";
import { config } from '@/config'
import { config } from "@/config";
import * as yup from "yup";
export default defineComponent({
Expand All @@ -57,7 +57,7 @@ export default defineComponent({
},
setup() {
const environment = config.veridaEnv;
console.log(environment)
console.log(environment);

Check warning on line 60 in src/components/SearchInput.vue

View workflow job for this annotation

GitHub Actions / build-app

Unexpected console statement
const schema = yup.object({
did: yup
.string()
Expand Down
2 changes: 0 additions & 2 deletions src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ const veridaExplorerUrls = {
testnet: process.env.VUE_APP_EXPLORER_URL_TESTNET,
};

console.log(veridaExplorerUrls);

export const config = {
nodeEnv,
veridaEnv,
Expand Down
5 changes: 3 additions & 2 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ export default defineComponent({
return x.datetime_utc.substring(0, 10);
});
console.log(dataGroupedByDay);

Check warning on line 247 in src/views/Home.vue

View workflow job for this annotation

GitHub Actions / build-app

Unexpected console statement
let currentDidCount = parseInt(
sortedData[0].activedids.replace(/ /g, "")
);
Expand All @@ -260,7 +262,7 @@ export default defineComponent({
// This abomination is due to stupid date handling
// Need to make sure this will return the format 'yyyy-MM-dd' no matter what locale the user has set.
// Note that months are zero indexed
const dtStr = `${dt.getFullYear()}-${(dt.getUTCMonth() + 1)
const dtStr = `${dt.getUTCFullYear()}-${(dt.getUTCMonth() + 1)
.toString()
.padStart(2, "0")}-${dt.getUTCDate().toString().padStart(2, "0")}`;
Expand All @@ -286,7 +288,6 @@ export default defineComponent({
): NormalizedData {
const dataGroupedByPeriod = groupBy(normalizedDailyData, (row) => {
let day = dayjs(row.x, "YYYY-MM-DD");
// Careful that this string sorts correctly over year boundries
if (period == "week") {
return day.format("YYYY WW"); // 2 digit week of year
Expand Down

0 comments on commit 5ea2eb7

Please sign in to comment.