Closed nomad-scl closed 3 years ago
Thank you for your report. We will fix the problem in the next update.
We have updated the program to fix this bug.
With this update, we have also updated here. https://github.com/MathNya/umya-spreadsheet/blob/c960006dea7a378f16da842c8f9d442438b4f4fb/src/structs/number_format.rs#L108-L109
it is working now, thanks
the following code :
let x1 = umya_spreadsheet::NumberFormat::FORMAT_DATE_YYYYMMDD; let x2 = umya_spreadsheet::NumberFormat::FORMAT_DATE_YYYYMMDD2; let x3 = umya_spreadsheet::NumberFormat::FORMAT_DATE_YYYYMMDDSLASH; let x4 = umya_spreadsheet::NumberFormat::FORMAT_DATE_DATETIME; let x5 = umya_spreadsheet::NumberFormat::FORMAT_DATE_DDMMYYYY; let x6 = umya_spreadsheet::NumberFormat::FORMAT_DATE_DMMINUS; let x7 = umya_spreadsheet::NumberFormat::FORMAT_DATE_DMYMINUS; let x8 = umya_spreadsheet::NumberFormat::FORMAT_DATE_DMYSLASH; let x9 = umya_spreadsheet::NumberFormat::FORMAT_DATE_XLSX22; let x10 = umya_spreadsheet::NumberFormat::FORMAT_DATE_XLSX17; let x11 = umya_spreadsheet::NumberFormat::FORMAT_DATE_XLSX16; let x12 = umya_spreadsheet::NumberFormat::FORMAT_DATE_XLSX15; let x13 = umya_spreadsheet::NumberFormat::FORMAT_DATE_XLSX14; println!("{:?}", to_formatted_string(cell.get_value(), &x1.to_string())); println!("{:?}", to_formatted_string(cell.get_value(), &x2.to_string())); println!("{:?}", to_formatted_string(cell.get_value(), &x3.to_string())); println!("{:?}", to_formatted_string(cell.get_value(), &x4.to_string())); println!("{:?}", to_formatted_string(cell.get_value(), &x5.to_string())); println!("{:?}", to_formatted_string(cell.get_value(), &x6.to_string())); println!("{:?}", to_formatted_string(cell.get_value(), &x7.to_string())); println!("{:?}", to_formatted_string(cell.get_value(), &x8.to_string())); println!("{:?}", to_formatted_string(cell.get_value(), &x9.to_string())); println!("{:?}", to_formatted_string(cell.get_value(), &x10.to_string())); println!("{:?}", to_formatted_string(cell.get_value(), &x11.to_string())); println!("{:?}", to_formatted_string(cell.get_value(), &x12.to_string())); println!("{:?}", to_formatted_string(cell.get_value(), &x13.to_string()));
presents the following output "2024-%m-%d" "2024-%m-%d" "2024/%m/%d" "12/05/24 0:00" "%d/%m/2024" "12-05" "12-05-24" "12/05/24" "05/12/24 0:00" "May-24" "12-May" "12-May-24" "%m-%d-24"
keep in mind that the data structure in the excel file is a correct date, I tried using different ways to represent the date in the excel cell but the result is the same, from the output above the date isn't always parsed correctly and I need the date to be formatted as DD/MM/YYYY