Skip to content

Commit

Permalink
fix(QDate): direction declaration (#17145)
Browse files Browse the repository at this point in the history
* Wrong usage of ref

* Update QDate.js

---------

Co-authored-by: sfn <[email protected]>
Co-authored-by: Razvan Stoenescu <[email protected]>
  • Loading branch information
3 people authored Apr 27, 2024
1 parent fa4c19e commit de0a91f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/src/components/date/QDate.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export default createComponent({

const view = ref(props.defaultView)

const direction = $q.lang.rtl === true ? 'right' : 'left'
const direction = computed(() => ($q.lang.rtl === true ? 'right' : 'left'))
const monthDirection = ref(direction.value)
const yearDirection = ref(direction.value)

Expand Down Expand Up @@ -931,7 +931,7 @@ export default createComponent({
const newHash = year + '/' + pad(month) + '/01'

if (newHash !== viewModel.value.dateHash) {
monthDirection.value = (viewModel.value.dateHash < newHash) === ($q.lang.rtl !== true) ? 'left' : 'right'
monthDirection.value = (viewModel.value.dateHash < newHash) === direction.value
if (year !== viewModel.value.year) {
yearDirection.value = monthDirection.value
}
Expand Down

0 comments on commit de0a91f

Please sign in to comment.