Skip to content

Commit

Permalink
Add custom constants, updating gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
Azizbek Jumanazarov committed Oct 15, 2024
1 parent b1314b5 commit 598b588
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
node_modules
/dist


# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
Expand Down
13 changes: 13 additions & 0 deletions src/@core/constants/site-constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
type SiteConstants = {
MIN_YEAR: number;
MAX_YEAR: number;
NUMBER_OF_RANDOM_COUNTRY: number;
};

const siteConstants: SiteConstants = {
MIN_YEAR: 2020,
MAX_YEAR: 2030,
NUMBER_OF_RANDOM_COUNTRY: 3,
};

export default siteConstants;
5 changes: 2 additions & 3 deletions src/components/Years.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

<script lang="ts">
import { defineComponent } from 'vue';
import siteConstants from '../@core/constants/site-constants';
export default defineComponent({
name: 'YearsRange',
emits: ['year-selected'],
Expand All @@ -30,16 +31,14 @@ export default defineComponent({
return {
listOfYears: [] as number[],
currentYear: new Date().getFullYear(),
startYear: 2020,
endYear: 2030,
};
},
created() {
this.getYears();
},
methods: {
getYears() {
for (let year = this.startYear; year <= this.endYear; year++) {
for (let year = siteConstants.MIN_YEAR; year <= siteConstants.MAX_YEAR; year++) {
this.listOfYears.push(year);
}
},
Expand Down

0 comments on commit 598b588

Please sign in to comment.