This repository has been archived by the owner on Mar 28, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cell date picker): cell date picker and bug solve
n
- Loading branch information
1 parent
0f90060
commit 2996ae9
Showing
7 changed files
with
92 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import menuButton from './menuButton'; | ||
import formula from '../global/formula'; | ||
import Store from '../store'; | ||
|
||
const cellDatePickerCtrl = { | ||
cellFocus: function(r, c, value){ | ||
let row = Store.visibledatarow[r], | ||
row_pre = r == 0 ? 0 : Store.visibledatarow[r - 1]; | ||
let col = Store.visibledatacolumn[c], | ||
col_pre = c == 0 ? 0 : Store.visibledatacolumn[c - 1]; | ||
|
||
let margeset = menuButton.mergeborer(Store.flowdata, r, c); | ||
if(!!margeset){ | ||
row = margeset.row[1]; | ||
row_pre = margeset.row[0]; | ||
|
||
col = margeset.column[1]; | ||
col_pre = margeset.column[0]; | ||
} | ||
|
||
$(".cell-date-picker").show().css({ | ||
width: col - col_pre + 1, | ||
height: row - row_pre + 1, | ||
left: col_pre, | ||
top: row_pre | ||
}) | ||
|
||
$("#cellDatePickerBtn").daterangepicker({ | ||
singleDatePicker: true, | ||
startDate: moment(value), | ||
endDate: moment(value) | ||
}, function(start) { | ||
$("#luckysheet-rich-text-editor").html(start.format('YYYY-MM-DD')); | ||
formula.updatecell(Store.luckysheetCellUpdate[0], Store.luckysheetCellUpdate[1]); | ||
}) | ||
|
||
$("#cellDatePickerBtn").click(); | ||
}, | ||
} | ||
|
||
export default cellDatePickerCtrl; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters