puvox-library 1.0.31 → 1.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/library_standard.js +14 -11
  2. package/package.json +1 -1
@@ -934,8 +934,12 @@ const puvox_library =
934
934
  msGoneAfter(date){
935
935
  return (new Date()-date);
936
936
  },
937
- getYMDHISFfromDate(dt){
938
- return [1900 + dt.getYear(), dt.getMonth()+1, dt.getDate(), dt.getHours(), dt.getMinutes(), dt.getSeconds(), dt.getMilliseconds()];
937
+ getYMDHISFfromDate(dt, utc=true){
938
+ if (utc) {
939
+ return [dt.getUTCFullYear(), dt.getUTCMonth()+1, dt.getUTCDate(), dt.getUTCHours(), dt.getUTCMinutes(), dt.getUTCSeconds(), dt.getUTCMilliseconds()];
940
+ } else {
941
+ return [1900 + dt.getYear(), dt.getMonth()+1, dt.getDate(), dt.getHours(), dt.getMinutes(), dt.getSeconds(), dt.getMilliseconds()];
942
+ }
939
943
  },
940
944
  prefixWithZero(num, digits){
941
945
  return (digits===1 ? num : (digits===2 ? (num < 10 ? "0"+num : num ) : (digits===3 ? (num < 10 ? "00"+num : (num < 100 ? "0"+num : num ) ) : num ) ) ).toString();
@@ -2754,15 +2758,14 @@ const puvox_library =
2754
2758
  // if(setHashInAddress) { window.location.hash = id_or_Name; }
2755
2759
 
2756
2760
 
2757
- async downloadFile(url, path){
2758
- const res = await this.fetch(url);
2759
- const fileStream = this.file.fs().createWriteStream(path);
2760
- await new Promise((resolve, reject) => {
2761
- res.body.pipe(fileStream);
2762
- res.body.on("error", reject);
2763
- fileStream.on("finish", resolve);
2764
- });
2765
- },
2761
+ // async downloadFile(url, path){
2762
+ // const { Readable } = require('stream');
2763
+ // const { finished } = require('stream/promises');
2764
+ // const response = await fetch(url);
2765
+ // const body = Readable.fromWeb(response.body);
2766
+ // const download_write_stream = this.file.fs().createWriteStream(filepath);
2767
+ // await finished(body.pipe(download_write_stream));
2768
+ // },
2766
2769
 
2767
2770
  unTrailingSlash(str){
2768
2771
  while (str.endsWith('/') || str.endsWith('\\')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "puvox-library",
3
- "version": "1.0.31",
3
+ "version": "1.0.32",
4
4
  "description": "library-class-javascript",
5
5
  "main": "library_standard.js",
6
6
  "scripts": {