When setting a date with v-date-picker v-text-field is not populated with selected date when v-mask is used - vuejs2

Has anyone seen/solved this issue? I have a component that utilizes v-date-picker and v-text-field. The text field is using v-mask for dynamic masking. The masking works well when date is typed in. However, when the date picker is used, it causes the text field's contents to be updated multiple times and the functions used to construct the mask are called multiple times as well. As a result, the text field ends up blank, and I get an error stating that time value is invalid.
I understand that the date picker is performing its own checks, and the format it's using for dates is different from what I need. I tried a workaround to limit the number of calls coming from the date picker and populate the text field with a saved value at the last call. But I either still get a blank field or the 'invalid time value' error.
When I set breakpoints in the masking functions, I do see the date in the text field before it disappears.

Related

How to do di-directional syncing between a date input field and a number input field?

I am attempting to create a "birthday" component in Vue.js. I have 2 v-text-field components, one that has a type="date" and another that has a type="number".
The idea is that the user will either enter a birth date or their age. If they enter their age, it will change what's in the date input and vice versa.
Everything works great except when I change the age input. Instead of updating the date input value, it just reverts it to mm/dd/yyyy.
I created a codepen here
I can't figure out why it's not working as the underlaying data property is correct (i added a derived text area to show that the properties are updating correctly that you can see in the example below the "date of birth" input.
Your problem is about difference between what format does age calculation and date calculation use. second one produces YYYY-MM-DD while first one produces MM/DD/YYYY.
Try this
this.birthDate = newBirthDate.toISOString().substring(0, 10)
instead of yours in age calculation, or whatever is more appropriate.

How can I determine the page number of a field in MS Word with VBA?

I am using the QR-Code DISPLAYBARCODE field. I am updating all DISPLAYBARCODE with some information like date and time, additionaly I want to add the page number on which the DISPLAYBARCODE field is.
For tables I would use the range field but this is not available for fields.
Is there a way how to do that?
If you want the page number to display as part of the QR Code, you could embed a page field in the text of the code. Something like:
{ DisplayBarCode "{ Date } { Time } Page { Page }" QR \s 100 \r 0 \q 3 }
Note the quotation marks. They are necessary.
The DATE and TIME fields are the date and time when the document is printed or those fields are updated. They are not fixed timestamps.
I am working on the code for you to enter a field like the one shown.
Is that what you want?
Do you want to have the page, date, and time appear inside the DisplayBarCode field so that they show up when the bar code is read?
Do you instead of the current date and time want a time stamp for when the code is run?
What else goes in the field? The current content? Before or after the date, time and page?
Take a look at the second answer in this thread (from WillWillPower): Setting up a nested field in Word using VBA
It uses the range of the field code.

How can using user defined function in custom data validation?

In my Worksheet I have a Table and want to define Data validation for a column that contained the date, as bellow:
=S2M(B2)<>"Error"
In above, S2M() is a user defined function for converting date from Persian date to Gregorian date, because checking input date is right.
But excel is not letting me use user defined functions in Custom Data validation.
This error shows: A named range you specified cannot be found.
Please note that I was using bellow code in Custom Data validation and that works, right.
=AND(LEN(B2)=10;ISNUMBER(IFERROR(VALUE(MATCH(VALUE(MID(B2;1;4));INDIRECT("intTable[Year]");0)&MATCH(MID(B2;6;2);INDIRECT("intTable[Mounth]");0)&MATCH(MID(B2;9;2);INDIRECT("intTable[Day]");0));FALSE)))
Explain is a Persian date example: 1396/05/25
Thanks.
You can do that. Select B2, or whichever cell in row 2 you want the validation to apply to. Now define a name called, say, IsValid, using:
=S2M(B2)<>"Error"
Now in the data validation box, all you need to enter is:
=IsValid
in the source box and make sure to uncheck the Ignore Blank option.

Google Script Sheets API - default number format

It looks like google sheets is making the same mistake as Excel, by "thinking ahead" and converting the value "1.1.1" to 2001.01.01 when doing sheet.appendRow. I have tried to set the number format of the column in charge to "#" (which should be plain text) before inserting rows - but looks ineffective. On the other hand doing the same after inserts is also ineffective, as the content is already "date".
Adding ' before is working, but it is not what I need.
Is there any way to give a default format or to disable such automatic conversion (from google script)?
I have a cell in which a form deposits a variable number of values seperated by a comma such as: " 1, 2, 4, 6 " etc - when there are only three answers, Google "helps" me by converting the value into a date object. But it's supposed to be a list of choices...
It's not pretty, but I've managed a workaround by using .getDisplayValue instead of .getValue - it does change the cell value into a string, so if you need to do further manipulations that are dependent on the value being a number or something, obviously, this fails.
I overwrite the value for the problem cell in my array before passing it to .appendRow
//getting the values
var values = s.getRange(row,1,1,lastCol).getValues()[0];
//brute force crushing of problem value
values[5] = s.getRange(row,6).getDisplayValue();

Changing the title of a column in a PivotTable

I am having trouble changing the title of some columns in a pivot table. I'm trying to make them have dates in them. Each date 6 days further from the last.
Like this
But, I cannot get an equation inside the column title to stay, every time I type in the equation and press enter, it evaluates to either 0 (If the format of the cell is number or general), or 1/0/1990 (If formatted as a date). I checked the value of the cell by =ISTEXT(A1) and it evaluates as true. No matter how I format the cell. So I can never change the title to look like the picture. Any ides?
Here is what I have.
TRUE is the result from ISTEXT()
Even if I manually enter in the formula via the function arguments, it'll show up correct, but when I click ok. It will go back to either 0 or 1/0/1990
Here's the original page
https://drive.google.com/file/d/0B3p8Jm7oNAo4ZUN0Qk1mR1cxYmM/view?usp=sharing
In Excel, dynamic values (formulas) in the header of a table-formatted table are not allowed.
Instead, you can first generate your table header and then format the table as (pivot-)table. You should get a message saying that the header row will be converted in static text (with correct format).