Skip to main content

All Questions

0 votes
1 answer
47 views

(JavaScript) How to split a paragraph string into lines without - str.split(/\r\n|\r|\n/g);

My program is supposed to take in a string and split it into an array of diffrent lines.The format of the string is shown bellow (it has no explicit \n, just a new line created through the enter key). ...
Evan's user avatar
  • 45
0 votes
1 answer
68 views

Format JavaScript vscode code to be like java in eclipse

I have code formatted like this subRedirect() { let features = this.config.get('features') if (features !== null) { features.forEach(feature => { ...
Mahmoud Elkafrawy's user avatar
-1 votes
1 answer
570 views

Download base64 encoded zip file I receive from server

I'm receiving a base64 encoded zip file from the server,and I have to save it. When I first receive the string it looks like this: After that, if I atob(content), it looks like this: Minimal ...
Knemay's user avatar
  • 425
0 votes
2 answers
495 views

libphonenumber-js validate on input

I'm using this library to format the phone input like this input: xxxxxxxxxxx formatter returns: xxxx xxx xx xx What i want and is not avaliable in the documentation is to prevent writing in the input ...
Fettah_Aud's user avatar
0 votes
0 answers
61 views

How to add a new line between LI items, so that when copied into google docs there will be an empty line between LI items

I currently have an unordered list with list items, however, when I paste this unordered list into google docs there is weird spacing when I try and newline the list items. As shown below, there is a ...
Salad's user avatar
  • 133
1 vote
0 answers
431 views

Format API response data into desired format in javascript

I get the below response from an API call, which i have just assigned to a variable finalUpdate for working. var finalUpdate = { creator: { "firstName": "Cruise", "...
NMSD's user avatar
  • 494
0 votes
0 answers
18 views

Ensuring file follows style guides

So I'm looking for a way to take eslint or prettier or one of the other linters / formatters to check files for adhering to a style guide that we have. I have seen plenty of examples of running ...
Samuel's user avatar
  • 584
0 votes
1 answer
132 views

Exception in thread "main" java.util.UnknownFormatConversionException: Conversion = '*'

This is how I call the method. public static void main(String[]args) { Scanner input = new Scanner(System.in); customPrint(7,10); This is my method public static void customPrint(int ...
Bob Lander's user avatar
1 vote
1 answer
2k views

How to convert seconds to 10h 20m in moment.js

How to convert seconds to 10h 20m in moment.js, I did not find such a solution, who show 0h 01m(example) result : 0h 01m
Uwis's user avatar
  • 72
8 votes
6 answers
31k views

How to get last 2 digits of year from Javascript date [duplicate]

I have string in the following format "30.11.2019". I need to transform it into a Date and get the short year representation (last 2 digits from year) like "19". The following code doesn't work var ...
Vytsalo's user avatar
  • 748
1 vote
1 answer
2k views

ApexCharts: Heatmap tooltip formatter

I'm using apexcharts to display a heatmap chart: The series are named with Date objects, which are formatted on the y-axis like this: yaxis: { labels: { formatter: function(value){ ...
LukeLR's user avatar
  • 1,189
1 vote
1 answer
69 views

Prettier - the meaning of parantheses around assigned variables

VS Code 1.16 I format code with Prettier with formatting on save. I get weird parantheses around assigned variables; I have these two variables Before formatting: tlProjectLoader = new ...
Sebastian's user avatar
  • 1,315
9 votes
1 answer
3k views

Preserve then() catch() format when using Prettier JS

I just started using the PrettierJS Plugin for VSCode and I am looking for a way to preserve my code format of my service calls (and subsequent Promises). I know you can add the //prettier-ignore ...
MaylorTaylor's user avatar
  • 5,071
1 vote
5 answers
1k views

Javascript format date

I have a date string which coming from the db as follows /Date(1469167371657)/ Is there any way to convert this date to following format using javascript MM/DD/YYYY HH:MM I've searched a lot but ...
tarzanbappa's user avatar
  • 4,978
0 votes
3 answers
111 views

Retrieve current date in JavaScript and format it like "Jun 30, 2014"

I know I can do this in Java with the Date and DataFormatter class. Is there something similar in JavaScript that allows me to do this?
Ben Sandler's user avatar
  • 2,403

15 30 50 per page